Class/Module 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
def __DIR__(*args)
  filename = caller[0][/^(.*):/, 1]
  dir = File.expand_path(File.dirname(filename))
  ::File.expand_path(::File.join(dir, *args.map{|a| a.to_s}))
end
instance_variable_defined?(variable) click to toggle source
# File lib/ramaze/snippets/object/instance_variable_defined.rb, line 10
def instance_variable_defined?(variable)
  instance_variables.include?(variable.to_s)
end
pretty(s = '') click to toggle source

Returns the string that pretty_inspect would yield

# File lib/ramaze/snippets/object/pretty.rb, line 6
def pretty s = ''
  PP.pp(self, s)
  s
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
def scope
  lambda{}
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.