Class: Stumb::Stub

Inherits:
Object
  • Object
show all
Defined in:
lib/stumb/stub.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*stub_response) ⇒ Stub

Returns a new instance of Stub.



7
8
9
10
# File 'lib/stumb/stub.rb', line 7

def initialize(*stub_response)
  @stamps = []
  @stub_response = stub_response
end

Instance Attribute Details

#stampsObject (readonly)

Returns the value of attribute stamps.



6
7
8
# File 'lib/stumb/stub.rb', line 6

def stamps
  @stamps
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
# File 'lib/stumb/stub.rb', line 12

def call(env)
  @stamps << Stamp.new(Rack::Request.new(env))
  @stub_response
end