Class: Spy::MethodCall
- Inherits:
-
Object
- Object
- Spy::MethodCall
- Defined in:
- lib/spy/method_call.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#caller ⇒ Object
readonly
Returns the value of attribute caller.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(replayer, name, receiver, method_caller, *args) ⇒ MethodCall
constructor
A new instance of MethodCall.
- #replay ⇒ Object
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
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/spy/method_call.rb', line 3 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
3 4 5 |
# File 'lib/spy/method_call.rb', line 3 def block @block end |
#caller ⇒ Object (readonly)
Returns the value of attribute caller.
3 4 5 |
# File 'lib/spy/method_call.rb', line 3 def caller @caller end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/spy/method_call.rb', line 3 def name @name end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
3 4 5 |
# File 'lib/spy/method_call.rb', line 3 def receiver @receiver end |
#result ⇒ Object
Returns the value of attribute result.
4 5 6 |
# File 'lib/spy/method_call.rb', line 4 def result @result end |
Instance Method Details
#replay ⇒ Object
15 16 17 |
# File 'lib/spy/method_call.rb', line 15 def replay @replayer.call end |