Class: Fcoin::RealTime::DepthFormatter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject

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_dataHash

Format response data for JSON

Returns:

  • (Hash)


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