Class: Buda::Ticker
- Inherits:
-
Object
- Object
- Buda::Ticker
- Defined in:
- lib/buda/resources/ticker.rb
Overview
for handling the total balance
Instance Attribute Summary collapse
-
#last_price ⇒ Object
readonly
Returns the value of attribute last_price.
-
#market_id ⇒ Object
readonly
Returns the value of attribute market_id.
-
#max_bid ⇒ Object
readonly
Returns the value of attribute max_bid.
-
#min_ask ⇒ Object
readonly
Returns the value of attribute min_ask.
-
#price_variation_24h ⇒ Object
readonly
Returns the value of attribute price_variation_24h.
-
#price_variation_7d ⇒ Object
readonly
Returns the value of attribute price_variation_7d.
-
#volume ⇒ Object
readonly
Returns the value of attribute volume.
Instance Method Summary collapse
-
#initialize(market_id:, last_price:, min_ask:, max_bid:, volume:, price_variation_24h:, price_variation_7d:) ⇒ Ticker
constructor
A new instance of Ticker.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(market_id:, last_price:, min_ask:, max_bid:, volume:, price_variation_24h:, price_variation_7d:) ⇒ Ticker
Returns a new instance of Ticker.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/buda/resources/ticker.rb', line 9 def initialize(market_id:, last_price:, min_ask:, max_bid:, volume:, price_variation_24h:, price_variation_7d:, **) @market_id = market_id @last_price = last_price[0] @min_ask = min_ask @max_bid = max_bid @price_variation_24h = price_variation_24h @volume = volume @price_variation_7d = price_variation_7d end |
Instance Attribute Details
#last_price ⇒ Object (readonly)
Returns the value of attribute last_price.
6 7 8 |
# File 'lib/buda/resources/ticker.rb', line 6 def last_price @last_price end |
#market_id ⇒ Object (readonly)
Returns the value of attribute market_id.
6 7 8 |
# File 'lib/buda/resources/ticker.rb', line 6 def market_id @market_id end |
#max_bid ⇒ Object (readonly)
Returns the value of attribute max_bid.
6 7 8 |
# File 'lib/buda/resources/ticker.rb', line 6 def max_bid @max_bid end |
#min_ask ⇒ Object (readonly)
Returns the value of attribute min_ask.
6 7 8 |
# File 'lib/buda/resources/ticker.rb', line 6 def min_ask @min_ask end |
#price_variation_24h ⇒ Object (readonly)
Returns the value of attribute price_variation_24h.
6 7 8 |
# File 'lib/buda/resources/ticker.rb', line 6 def price_variation_24h @price_variation_24h end |
#price_variation_7d ⇒ Object (readonly)
Returns the value of attribute price_variation_7d.
6 7 8 |
# File 'lib/buda/resources/ticker.rb', line 6 def price_variation_7d @price_variation_7d end |
#volume ⇒ Object (readonly)
Returns the value of attribute volume.
6 7 8 |
# File 'lib/buda/resources/ticker.rb', line 6 def volume @volume end |
Instance Method Details
#inspect ⇒ Object
26 27 28 |
# File 'lib/buda/resources/ticker.rb', line 26 def inspect "<Ticker #{@market_id} (#{@last_price})>" end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/buda/resources/ticker.rb', line 22 def to_s "#{@market_id} (#{@last_price})" end |