Class: CrossStub::Stubber::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/cross-stub/stubber.rb

Instance Method Summary collapse

Constructor Details

#initialize(thing) ⇒ Instance

Returns a new instance of Instance.



95
96
97
# File 'lib/cross-stub/stubber.rb', line 95

def initialize(thing)
  @thing = thing
end

Instance Method Details

#has_method?(method) ⇒ Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/cross-stub/stubber.rb', line 105

def has_method?(method)
  @thing.instance_methods.map{|m| m.to_s }.include?(method.to_s)
end

#m_eval(str) ⇒ Object Also known as: t_eval



99
100
101
# File 'lib/cross-stub/stubber.rb', line 99

def m_eval(str)
  @thing.class_eval(str)
end