Class: Spy::FakeMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/spy/fake_method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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