Class: Fcoin::RealTime::DepthFormatter
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- Fcoin::RealTime::DepthFormatter
- Defined in:
- lib/fcoin/realtime/formatter/depth_formatter.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
-
#formatted_data ⇒ Hash
Format response data for JSON.
-
#initialize(data) ⇒ DepthFormatter
constructor
A new instance of DepthFormatter.
Constructor Details
#initialize(data) ⇒ DepthFormatter
Returns a new instance of DepthFormatter.
11 12 13 |
# File 'lib/fcoin/realtime/formatter/depth_formatter.rb', line 11 def initialize(data) self.data = data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
9 10 11 |
# File 'lib/fcoin/realtime/formatter/depth_formatter.rb', line 9 def data @data end |
Instance Method Details
#formatted_data ⇒ Hash
Format response data for JSON
18 19 20 21 22 |
# File 'lib/fcoin/realtime/formatter/depth_formatter.rb', line 18 def formatted_data self.data['bids'] = adjusted('bids') self.data['asks'] = adjusted('asks') data end |