Class Index [+]

Quicksearch

Ramaze::CoreExtensions::Object

Extensions for Object


Extensions for Object


Extensions for Object


Extensions for Object

Public Instance Methods

__DIR__(*args) click to toggle source

This is similar to FILE and LINE, and returns a String representing the directory of the current file is. Unlike FILE the path returned is absolute.

This method is convenience for the

 File.expand_path(File.dirname(__FILE__))

idiom.

    # File lib/ramaze/snippets/object/__dir__.rb, line 17
17:         def __DIR__(*args)
18:           filename = caller[0][/^(.*):/, 1]
19:           dir = File.expand_path(File.dirname(filename))
20:           ::File.expand_path(::File.join(dir, *args.map{|a| a.to_s}))
21:         end
instance_variable_defined?(variable) click to toggle source
    # File lib/ramaze/snippets/object/instance_variable_defined.rb, line 10
10:         def instance_variable_defined?(variable)
11:           instance_variables.include?(variable.to_s)
12:         end
pretty(s = '') click to toggle source

Returns the string that # would yield

   # File lib/ramaze/snippets/object/pretty.rb, line 6
6:       def pretty s = ''
7:         PP.pp(self, s)
8:         s
9:       end
scope() click to toggle source

returns a new clean binding for this object

Usage:

    eval 'self', object.scope  #=> returns object
    # File lib/ramaze/snippets/object/scope.rb, line 11
11:       def scope
12:         lambda{}
13:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.