Class: Bittrex::Market

Inherits:
Object
  • Object
show all
Defined in:
lib/bittrex/market.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#activeObject (readonly)

Returns the value of attribute active.



3
4
5
# File 'lib/bittrex/market.rb', line 3

def active
  @active
end

#baseObject (readonly)

Returns the value of attribute base.



3
4
5
# File 'lib/bittrex/market.rb', line 3

def base
  @base
end

#base_nameObject (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_atObject (readonly)

Returns the value of attribute created_at.



3
4
5
# File 'lib/bittrex/market.rb', line 3

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



3
4
5
# File 'lib/bittrex/market.rb', line 3

def currency
  @currency
end

#currency_nameObject (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_tradeObject (readonly)

Returns the value of attribute minimum_trade.



3
4
5
# File 'lib/bittrex/market.rb', line 3

def minimum_trade
  @minimum_trade
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/bittrex/market.rb', line 3

def name
  @name
end

#rawObject (readonly)

Returns the value of attribute raw.



3
4
5
# File 'lib/bittrex/market.rb', line 3

def raw
  @raw
end

Class Method Details

.allObject



17
18
19
# File 'lib/bittrex/market.rb', line 17

def self.all
  client.get('public/getmarkets').map{|data| new(data) }
end