Class: Terminalwire::Resource::Base
- Inherits:
-
Object
- Object
- Terminalwire::Resource::Base
- Defined in:
- lib/terminalwire.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #connect ⇒ Object
- #disconnect ⇒ Object
- #fail(response, **data) ⇒ Object
-
#initialize(name, adapter) ⇒ Base
constructor
A new instance of Base.
- #succeed(response, **data) ⇒ Object
Constructor Details
#initialize(name, adapter) ⇒ Base
Returns a new instance of Base.
32 33 34 35 |
# File 'lib/terminalwire.rb', line 32 def initialize(name, adapter) @name = name.to_s @adapter = adapter end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
30 31 32 |
# File 'lib/terminalwire.rb', line 30 def adapter @adapter end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
30 31 32 |
# File 'lib/terminalwire.rb', line 30 def name @name end |
Instance Method Details
#connect ⇒ Object
37 |
# File 'lib/terminalwire.rb', line 37 def connect; end |
#disconnect ⇒ Object
38 |
# File 'lib/terminalwire.rb', line 38 def disconnect; end |
#fail(response, **data) ⇒ Object
40 41 42 |
# File 'lib/terminalwire.rb', line 40 def fail(response, **data) respond(status: "failure", response:, **data) end |
#succeed(response, **data) ⇒ Object
44 45 46 |
# File 'lib/terminalwire.rb', line 44 def succeed(response, **data) respond(status: "success", response:, **data) end |