Class: Fcoin::DepthFormatter
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- Fcoin::DepthFormatter
- Defined in:
- lib/fcoin/formatter/depth_formatter.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
Instance Method Summary collapse
-
#formatted_body ⇒ Hash
Format response body for JSON.
-
#initialize(body) ⇒ DepthFormatter
constructor
A new instance of DepthFormatter.
Constructor Details
#initialize(body) ⇒ DepthFormatter
Returns a new instance of DepthFormatter.
8 9 10 |
# File 'lib/fcoin/formatter/depth_formatter.rb', line 8 def initialize(body) self.body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'lib/fcoin/formatter/depth_formatter.rb', line 6 def body @body end |
Instance Method Details
#formatted_body ⇒ Hash
Format response body for JSON
15 16 17 18 19 |
# File 'lib/fcoin/formatter/depth_formatter.rb', line 15 def formatted_body self.body['data']['bids'] = adjusted('bids') self.body['data']['asks'] = adjusted('asks') body end |