Class: Bittrex::Market
- Inherits:
-
Object
- Object
- Bittrex::Market
- Defined in:
- lib/bittrex/market.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#base_name ⇒ Object
readonly
Returns the value of attribute base_name.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#currency_name ⇒ Object
readonly
Returns the value of attribute currency_name.
-
#minimum_trade ⇒ Object
readonly
Returns the value of attribute minimum_trade.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Market
constructor
A new instance of Market.
Constructor Details
#initialize(attrs = {}) ⇒ Market
Returns a new instance of Market.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/bittrex/market.rb', line 5 def initialize(attrs = {}) @name = attrs['MarketName'] @currency = attrs['MarketCurrency'] @base = attrs['BaseCurrency'] @currency_name = attrs['MarketCurrencyLong'] @base_name = attrs['BaseCurrencyLong'] @minimum_trade = attrs['MinTradeSize'] @active = attrs['IsActive'] @created_at = Time.parse(attrs['Created']) @raw = attrs end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
3 4 5 |
# File 'lib/bittrex/market.rb', line 3 def active @active end |
#base ⇒ Object (readonly)
Returns the value of attribute base.
3 4 5 |
# File 'lib/bittrex/market.rb', line 3 def base @base end |
#base_name ⇒ Object (readonly)
Returns the value of attribute base_name.
3 4 5 |
# File 'lib/bittrex/market.rb', line 3 def base_name @base_name end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/bittrex/market.rb', line 3 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
3 4 5 |
# File 'lib/bittrex/market.rb', line 3 def currency @currency end |
#currency_name ⇒ Object (readonly)
Returns the value of attribute currency_name.
3 4 5 |
# File 'lib/bittrex/market.rb', line 3 def currency_name @currency_name end |
#minimum_trade ⇒ Object (readonly)
Returns the value of attribute minimum_trade.
3 4 5 |
# File 'lib/bittrex/market.rb', line 3 def minimum_trade @minimum_trade end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/bittrex/market.rb', line 3 def name @name end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
3 4 5 |
# File 'lib/bittrex/market.rb', line 3 def raw @raw end |
Class Method Details
.all ⇒ Object
17 18 19 |
# File 'lib/bittrex/market.rb', line 17 def self.all client.get('public/getmarkets').map{|data| new(data) } end |