Class: Spy::MethodCall

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(replayer, name, receiver, method_caller, *args) ⇒ MethodCall

Returns a new instance of MethodCall.



6
7
8
9
10
11
12
13
# File 'lib/spy/method_call.rb', line 6

def initialize(replayer, name, receiver, method_caller, *args)
  @replayer = replayer
  @name     = name
  @receiver = receiver
  @args     = args
  @caller   = method_caller
  @block    = Proc.new if block_given?
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



3
4
5
# File 'lib/spy/method_call.rb', line 3

def args
  @args
end

#blockObject (readonly)

Returns the value of attribute block.



3
4
5
# File 'lib/spy/method_call.rb', line 3

def block
  @block
end

#callerObject (readonly)

Returns the value of attribute caller.



3
4
5
# File 'lib/spy/method_call.rb', line 3

def caller
  @caller
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/spy/method_call.rb', line 3

def name
  @name
end

#receiverObject (readonly)

Returns the value of attribute receiver.



3
4
5
# File 'lib/spy/method_call.rb', line 3

def receiver
  @receiver
end

#resultObject

Returns the value of attribute result.



4
5
6
# File 'lib/spy/method_call.rb', line 4

def result
  @result
end

Instance Method Details

#replayObject



15
16
17
# File 'lib/spy/method_call.rb', line 15

def replay
  @replayer.call
end