Class: Twirbet::Transports::FakeTransport
- Inherits:
-
Object
- Object
- Twirbet::Transports::FakeTransport
- Extended by:
- T::Sig
- Includes:
- Twirbet::Transport
- Defined in:
- lib/twirbet/transports/fake_transport.rb
Instance Attribute Summary collapse
-
#requests ⇒ Object
readonly
Returns the value of attribute requests.
Instance Method Summary collapse
- #call(request) ⇒ Object
- #clear ⇒ Object
-
#initialize ⇒ FakeTransport
constructor
A new instance of FakeTransport.
Constructor Details
#initialize ⇒ FakeTransport
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
#requests ⇒ Object (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 |
#clear ⇒ Object
27 28 29 |
# File 'lib/twirbet/transports/fake_transport.rb', line 27 def clear requests.clear end |