Class: CrossStub::Stubber::Instance
- Inherits:
-
Object
- Object
- CrossStub::Stubber::Instance
- Defined in:
- lib/cross-stub/stubber.rb
Instance Method Summary collapse
- #has_method?(method) ⇒ Boolean
-
#initialize(thing) ⇒ Instance
constructor
A new instance of Instance.
- #m_eval(str) ⇒ Object (also: #t_eval)
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
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 |