Class: Caricature::BlockCallRecording
- Defined in:
- lib/caricature/method_call_recorder.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#call_number ⇒ Object
Returns the value of attribute call_number.
Instance Method Summary collapse
-
#==(other) ⇒ Object
compares one block variation to another.
-
#initialize(*args) ⇒ BlockCallRecording
constructor
A new instance of BlockCallRecording.
Constructor Details
#initialize(*args) ⇒ BlockCallRecording
Returns a new instance of BlockCallRecording.
7 8 9 10 |
# File 'lib/caricature/method_call_recorder.rb', line 7 def initialize(*args) @call_number = 1 @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/caricature/method_call_recorder.rb', line 5 def args @args end |
#call_number ⇒ Object
Returns the value of attribute call_number.
4 5 6 |
# File 'lib/caricature/method_call_recorder.rb', line 4 def call_number @call_number end |
Instance Method Details
#==(other) ⇒ Object
compares one block variation to another. Also takes an array as an argument
14 15 16 17 18 |
# File 'lib/caricature/method_call_recorder.rb', line 14 def ==(other) other = self.class.new(other) if other.respond_to?(:each) return true if other.args.first.is_a?(Symbol) and other.args.first == :any other.args == args end |