module Real

Private Class Methods

const_missing(const_name) click to toggle source

Access to project metadata, e.g. VERSION.

Calls superclass method
# File lib/real.rb, line 92
def self.const_missing(const_name)
  name = const_name.to_s.downcase
  index[name] || super(const_name)
end
index() click to toggle source

Load project metadata file.

# File lib/real.rb, line 100
def self.index
  @index ||= (
    require 'yaml'
    YAML.load_file(File.join(File.dirname(__FILE__), 'real.yml'))
  )
end

Public Instance Methods

class(*a, &b) click to toggle source

Get object’s real class.

@return [Class]

# File lib/real.rb, line 18
def class(*a, &b)
  bind_call(Object, :class, *a, &b)
end
id(*a, &b) click to toggle source

Get object’s real id.

@return [Integer]

# File lib/real.rb, line 11
def id(*a, &b)
  bind_call(Object, :object_id, *a, &b)
end
instance_methods(*a, &b) click to toggle source

Get class/module’s real instance methods.

@return [Array<Symbol>]

# File lib/real.rb, line 57
def instance_methods(*a, &b)
  bind_call(Module, :instanance_methods, *a, &b)
end
methods(*a, &b) click to toggle source

Get object’s real methods.

@return [Array<Symbol>]

# File lib/real.rb, line 25
def methods(*a, &b)
  bind_call(Object, :methods, *a, &b)
end
private_instance_methods(*a, &b) click to toggle source

Get class/module’s real private instance methods.

@return [Array<Symbol>]

# File lib/real.rb, line 78
def private_instance_methods(*a, &b)
  bind_call(Module, :private_instance_methods, :class, *a, &b)
end
private_methods(*a, &b) click to toggle source

Get object’s real private methods.

@return [Array<Symbol>]

# File lib/real.rb, line 46
def private_methods(*a, &b)
  bind_call(Object, :private_methods, *a, &b)
end
protected_instance_methods(*a, &b) click to toggle source

Get class/module’s real protected instance methods.

@return [Array<Symbol>]

# File lib/real.rb, line 71
def protected_instance_methods(*a, &b)
  bind_call(Module, :protected_instance_methods, *a, &b)
end
protected_methods(*a, &b) click to toggle source

Get object’s real protected methods.

@return [Array<Symbol>]

# File lib/real.rb, line 39
def protected_methods(*a, &b)
  bind_call(Object, :protected_methods, *a, &b)
end
public_instance_methods(*a, &b) click to toggle source

Get class/module’s real public instance methods.

@return [Array<Symbol>]

# File lib/real.rb, line 64
def public_instance_methods(*a, &b)
  bind_call(Module, :public_instance_methods, *a, &b)
end
public_methods(*a, &b) click to toggle source

Get object’s real public methods.

@return [Array<Symbol>]

# File lib/real.rb, line 32
def public_methods(*a, &b)
  bind_call(Object, :public_methods, *a, &b)
end

Private Instance Methods

bind_call(c, m, o, *a, &b) click to toggle source
# File lib/real.rb, line 84
def bind_call(c, m, o, *a, &b)
  im = c.instance_method(m) 
  im.bind(o).call(*a, &b)    
end