Class: Deribit::WS::BaseHandler
- Inherits:
-
Object
- Object
- Deribit::WS::BaseHandler
- Defined in:
- lib/deribit/ws/base_handler.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#ws ⇒ Object
Returns the value of attribute ws.
Instance Method Summary collapse
-
#initialize ⇒ BaseHandler
constructor
A new instance of BaseHandler.
- #process(json, method: nil, ws: nil) ⇒ Object
Constructor Details
#initialize ⇒ BaseHandler
Returns a new instance of BaseHandler.
6 7 8 |
# File 'lib/deribit/ws/base_handler.rb', line 6 def initialize end |
Instance Attribute Details
#timestamp ⇒ Object
Returns the value of attribute timestamp.
4 5 6 |
# File 'lib/deribit/ws/base_handler.rb', line 4 def @timestamp end |
#ws ⇒ Object
Returns the value of attribute ws.
4 5 6 |
# File 'lib/deribit/ws/base_handler.rb', line 4 def ws @ws end |
Instance Method Details
#process(json, method: nil, ws: nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/deribit/ws/base_handler.rb', line 10 def process(json, method: nil, ws: nil) @ws = ws if method && self.respond_to?(method) self.send(method, json) else puts "Received method #{method}: #{json}" end end |