Class: Twirbet::Transports::FakeTransport

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Twirbet::Transport
Defined in:
lib/twirbet/transports/fake_transport.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFakeTransport

Returns a new instance of FakeTransport.



16
17
18
# File 'lib/twirbet/transports/fake_transport.rb', line 16

def initialize
  @requests = []
end

Instance Attribute Details

#requestsObject (readonly)

Returns the value of attribute requests.



13
14
15
# File 'lib/twirbet/transports/fake_transport.rb', line 13

def requests
  @requests
end

Instance Method Details

#call(request) ⇒ Object



21
22
23
24
# File 'lib/twirbet/transports/fake_transport.rb', line 21

def call(request)
  requests << request
  Transport::Response.new(200, {}, "")
end

#clearObject



27
28
29
# File 'lib/twirbet/transports/fake_transport.rb', line 27

def clear
  requests.clear
end