Class: RuBittrex::Ticker

Inherits:
Object
  • Object
show all
Extended by:
ClientHelper
Includes:
Helpers
Defined in:
lib/ru_bittrex/ticker.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#extract_timestamp

Constructor Details

#initialize(attrs = {}) ⇒ Ticker

Returns a new instance of Ticker.



8
9
10
11
12
13
14
# File 'lib/ru_bittrex/ticker.rb', line 8

def initialize(attrs = {})
  @symbol    = attrs["symbol"]
  @last_rate = attrs["lastTradeRate"]
  @bid_rate  = attrs["bidRate"]
  @ask_rate  = attrs["askRate"]
  @raw       = attrs
end

Instance Attribute Details

#ask_rateObject (readonly)

Returns the value of attribute ask_rate.



6
7
8
# File 'lib/ru_bittrex/ticker.rb', line 6

def ask_rate
  @ask_rate
end

#bid_rateObject (readonly)

Returns the value of attribute bid_rate.



6
7
8
# File 'lib/ru_bittrex/ticker.rb', line 6

def bid_rate
  @bid_rate
end

#last_rateObject (readonly)

Returns the value of attribute last_rate.



6
7
8
# File 'lib/ru_bittrex/ticker.rb', line 6

def last_rate
  @last_rate
end

#rawObject (readonly)

Returns the value of attribute raw.



6
7
8
# File 'lib/ru_bittrex/ticker.rb', line 6

def raw
  @raw
end

#symbolObject (readonly)

Returns the value of attribute symbol.



6
7
8
# File 'lib/ru_bittrex/ticker.rb', line 6

def symbol
  @symbol
end

Class Method Details

.all(params = {}) ⇒ Object



16
17
18
# File 'lib/ru_bittrex/ticker.rb', line 16

def self.all(params = {})
  collection _get('markets/tickers', params)
end

.get(market, params = {}) ⇒ Object



20
21
22
# File 'lib/ru_bittrex/ticker.rb', line 20

def self.get(market, params = {})
  new _get("markets/#{market}/ticker", params)
end