Class: Spy::FakeMethod
- Inherits:
-
Object
- Object
- Spy::FakeMethod
- Defined in:
- lib/spy/fake_method.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #call(*args, &block) ⇒ Object
-
#initialize(name, &block) ⇒ FakeMethod
constructor
A new instance of FakeMethod.
Constructor Details
#initialize(name, &block) ⇒ FakeMethod
Returns a new instance of FakeMethod.
5 6 7 8 |
# File 'lib/spy/fake_method.rb', line 5 def initialize(name, &block) @name = name @block = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/spy/fake_method.rb', line 3 def name @name end |
Instance Method Details
#call(*args, &block) ⇒ Object
10 11 12 |
# File 'lib/spy/fake_method.rb', line 10 def call(*args, &block) @block.call(*args, &block) end |