Class: BitFlyer::Models::Ticker

Inherits:
Object
  • Object
show all
Defined in:
lib/bit_flyer/models/ticker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Ticker

Returns a new instance of Ticker.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/bit_flyer/models/ticker.rb', line 17

def initialize(attrs = {})
  @product_code = attrs['product_code']
  @timestamp = Time.parse(attrs['timestamp']).in_time_zone('Tokyo')
  @tick_id = attrs['tick_id']
  @best_bid = attrs['best_bid']
  @best_ask = attrs['best_ask']
  @best_bid_size = attrs['best_bid_size']
  @best_ask_size = attrs['best_ask_size']
  @total_bid_depth = attrs['total_bid_depth']
  @total_ask_depth = attrs['total_ask_depth']
  @ltp = attrs['ltp']
  @volume = attrs['volume']
  @volume_by_product = attrs['volume_by_product']
end

Instance Attribute Details

#best_askObject (readonly)

Returns the value of attribute best_ask.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def best_ask
  @best_ask
end

#best_ask_sizeObject (readonly)

Returns the value of attribute best_ask_size.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def best_ask_size
  @best_ask_size
end

#best_bidObject (readonly)

Returns the value of attribute best_bid.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def best_bid
  @best_bid
end

#best_bid_sizeObject (readonly)

Returns the value of attribute best_bid_size.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def best_bid_size
  @best_bid_size
end

#ltpObject (readonly)

Returns the value of attribute ltp.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def ltp
  @ltp
end

#product_codeObject (readonly)

Returns the value of attribute product_code.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def product_code
  @product_code
end

#tick_idObject (readonly)

Returns the value of attribute tick_id.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def tick_id
  @tick_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def timestamp
  @timestamp
end

#total_ask_depthObject (readonly)

Returns the value of attribute total_ask_depth.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def total_ask_depth
  @total_ask_depth
end

#total_bid_depthObject (readonly)

Returns the value of attribute total_bid_depth.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def total_bid_depth
  @total_bid_depth
end

#volumeObject (readonly)

Returns the value of attribute volume.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def volume
  @volume
end

#volume_by_productObject (readonly)

Returns the value of attribute volume_by_product.



4
5
6
# File 'lib/bit_flyer/models/ticker.rb', line 4

def volume_by_product
  @volume_by_product
end