Class: CrossStub::Stubber::Klass
- Inherits:
-
Object
- Object
- CrossStub::Stubber::Klass
- Defined in:
- lib/cross-stub/stubber.rb
Instance Method Summary collapse
- #has_method?(method) ⇒ Boolean
-
#initialize(thing) ⇒ Klass
constructor
A new instance of Klass.
- #m_eval(str) ⇒ Object
- #t_eval(str) ⇒ Object
Constructor Details
#initialize(thing) ⇒ Klass
Returns a new instance of Klass.
113 114 115 |
# File 'lib/cross-stub/stubber.rb', line 113 def initialize(thing) @thing = thing end |
Instance Method Details
#has_method?(method) ⇒ Boolean
125 126 127 |
# File 'lib/cross-stub/stubber.rb', line 125 def has_method?(method) @thing.respond_to?(method) end |
#m_eval(str) ⇒ Object
117 118 119 |
# File 'lib/cross-stub/stubber.rb', line 117 def m_eval(str) (class << @thing ; self ; end).instance_eval(str) end |
#t_eval(str) ⇒ Object
121 122 123 |
# File 'lib/cross-stub/stubber.rb', line 121 def t_eval(str) @thing.instance_eval(str) end |