Class: Fcoin::DepthFormatter

Inherits:
BaseFormatter show all
Defined in:
lib/fcoin/formatter/depth_formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject

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_bodyHash

Format response body for JSON

Returns:

  • (Hash)


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