Class: Coinone::Public::Tickers
- Inherits:
-
Object
- Object
- Coinone::Public::Tickers
- Defined in:
- lib/coinone/public/tickers.rb,
lib/coinone/public/tickers/ticker.rb
Defined Under Namespace
Classes: Ticker
Instance Attribute Summary collapse
-
#tickers ⇒ Object
readonly
Returns the value of attribute tickers.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Tickers
constructor
A new instance of Tickers.
- #push_tickers(params) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Tickers
Returns a new instance of Tickers.
8 9 10 11 |
# File 'lib/coinone/public/tickers.rb', line 8 def initialize(params={}) @tickers = [] push_tickers(params) end |
Instance Attribute Details
#tickers ⇒ Object (readonly)
Returns the value of attribute tickers.
6 7 8 |
# File 'lib/coinone/public/tickers.rb', line 6 def tickers @tickers end |
Instance Method Details
#push_tickers(params) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/coinone/public/tickers.rb', line 13 def push_tickers(params) currency_list = [:btc, :eth, :etc] currency_list.each do |currency| if params.has_key? currency @tickers.push(Ticker.new(params[currency])) end end @tickers.push(Ticker.new(params)) if params.has_key? :currency end |