Class: Vertpig::Market
- Inherits:
-
Object
- Object
- Vertpig::Market
- Includes:
- Helpers
- Defined in:
- lib/vertpig/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.
Methods included from Helpers
Constructor Details
#initialize(attrs = {}) ⇒ Market
Returns a new instance of Market.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/vertpig/market.rb', line 9 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 = (attrs['Created']) @raw = attrs end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
7 8 9 |
# File 'lib/vertpig/market.rb', line 7 def active @active end |
#base ⇒ Object (readonly)
Returns the value of attribute base.
7 8 9 |
# File 'lib/vertpig/market.rb', line 7 def base @base end |
#base_name ⇒ Object (readonly)
Returns the value of attribute base_name.
7 8 9 |
# File 'lib/vertpig/market.rb', line 7 def base_name @base_name end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/vertpig/market.rb', line 7 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/vertpig/market.rb', line 7 def currency @currency end |
#currency_name ⇒ Object (readonly)
Returns the value of attribute currency_name.
7 8 9 |
# File 'lib/vertpig/market.rb', line 7 def currency_name @currency_name end |
#minimum_trade ⇒ Object (readonly)
Returns the value of attribute minimum_trade.
7 8 9 |
# File 'lib/vertpig/market.rb', line 7 def minimum_trade @minimum_trade end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/vertpig/market.rb', line 7 def name @name end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
7 8 9 |
# File 'lib/vertpig/market.rb', line 7 def raw @raw end |
Class Method Details
.all ⇒ Object
21 22 23 |
# File 'lib/vertpig/market.rb', line 21 def self.all client.get('public/getmarkets').map{|data| new(data) } end |