Class: Bitfinex::Models::FundingTicker
- Defined in:
- lib/models/funding_ticker.rb
Instance Attribute Summary collapse
-
#ask ⇒ Object
Returns the value of attribute ask.
-
#ask_period ⇒ Object
Returns the value of attribute ask_period.
-
#ask_size ⇒ Object
Returns the value of attribute ask_size.
-
#bid ⇒ Object
Returns the value of attribute bid.
-
#bid_period ⇒ Object
Returns the value of attribute bid_period.
-
#bid_size ⇒ Object
Returns the value of attribute bid_size.
-
#daily_change ⇒ Object
Returns the value of attribute daily_change.
-
#daily_change_perc ⇒ Object
Returns the value of attribute daily_change_perc.
-
#frr ⇒ Object
Returns the value of attribute frr.
-
#high ⇒ Object
Returns the value of attribute high.
-
#last_price ⇒ Object
Returns the value of attribute last_price.
-
#low ⇒ Object
Returns the value of attribute low.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
-
#volume ⇒ Object
Returns the value of attribute volume.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ FundingTicker
constructor
A new instance of FundingTicker.
- #serialize ⇒ Object
Methods inherited from Model
Constructor Details
#initialize(data) ⇒ FundingTicker
Returns a new instance of FundingTicker.
10 11 12 |
# File 'lib/models/funding_ticker.rb', line 10 def initialize (data) super(data, {}, []) end |
Instance Attribute Details
#ask ⇒ Object
Returns the value of attribute ask.
6 7 8 |
# File 'lib/models/funding_ticker.rb', line 6 def ask @ask end |
#ask_period ⇒ Object
Returns the value of attribute ask_period.
7 8 9 |
# File 'lib/models/funding_ticker.rb', line 7 def ask_period @ask_period end |
#ask_size ⇒ Object
Returns the value of attribute ask_size.
7 8 9 |
# File 'lib/models/funding_ticker.rb', line 7 def ask_size @ask_size end |
#bid ⇒ Object
Returns the value of attribute bid.
6 7 8 |
# File 'lib/models/funding_ticker.rb', line 6 def bid @bid end |
#bid_period ⇒ Object
Returns the value of attribute bid_period.
6 7 8 |
# File 'lib/models/funding_ticker.rb', line 6 def bid_period @bid_period end |
#bid_size ⇒ Object
Returns the value of attribute bid_size.
6 7 8 |
# File 'lib/models/funding_ticker.rb', line 6 def bid_size @bid_size end |
#daily_change ⇒ Object
Returns the value of attribute daily_change.
7 8 9 |
# File 'lib/models/funding_ticker.rb', line 7 def daily_change @daily_change end |
#daily_change_perc ⇒ Object
Returns the value of attribute daily_change_perc.
7 8 9 |
# File 'lib/models/funding_ticker.rb', line 7 def daily_change_perc @daily_change_perc end |
#frr ⇒ Object
Returns the value of attribute frr.
6 7 8 |
# File 'lib/models/funding_ticker.rb', line 6 def frr @frr end |
#high ⇒ Object
Returns the value of attribute high.
8 9 10 |
# File 'lib/models/funding_ticker.rb', line 8 def high @high end |
#last_price ⇒ Object
Returns the value of attribute last_price.
8 9 10 |
# File 'lib/models/funding_ticker.rb', line 8 def last_price @last_price end |
#low ⇒ Object
Returns the value of attribute low.
8 9 10 |
# File 'lib/models/funding_ticker.rb', line 8 def low @low end |
#symbol ⇒ Object
Returns the value of attribute symbol.
6 7 8 |
# File 'lib/models/funding_ticker.rb', line 6 def symbol @symbol end |
#volume ⇒ Object
Returns the value of attribute volume.
8 9 10 |
# File 'lib/models/funding_ticker.rb', line 8 def volume @volume end |
Class Method Details
.unserialize(arr) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/models/funding_ticker.rb', line 26 def self.unserialize (arr) symbol = arr[0] payload = arr[1] data = payload.kind_of?(Array) ? payload : arr.dup[1..-1] { :symbol => symbol, :frr => data[0], :bid => data[1], :bid_period => data[2], :bid_size => data[3], :ask => data[4], :ask_period => data[5], :ask_size => data[6], :daily_change => data[7], :daily_change_perc => data[8], :last_price => data[9], :volume => data[10], :high => data[11], :low => data[12] } end |
Instance Method Details
#serialize ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/models/funding_ticker.rb', line 14 def serialize () [ self.symbol, [ self.frr, self.bid, self.bid_period, self.bid_size, self.ask, self.ask_period, self.ask_size, self.daily_change, self.daily_change_perc, self.last_price, self.volume, self.high, self.low ] ] end |