Class: Caricature::BlockCallRecording

Inherits:
Object
  • Object
show all
Defined in:
lib/caricature/method_call_recorder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argsObject (readonly)

Returns the value of attribute args.



5
6
7
# File 'lib/caricature/method_call_recorder.rb', line 5

def args
  @args
end

#call_numberObject

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