Class: Coingecko::Global
- Inherits:
-
Object
- Object
- Coingecko::Global
- Defined in:
- lib/coingecko/global.rb
Constant Summary collapse
- @@all_coins_list =
[]
Instance Attribute Summary collapse
-
#active_cryptocurrencies ⇒ Object
Returns the value of attribute active_cryptocurrencies.
-
#data ⇒ Object
Returns the value of attribute data.
-
#ended_icos ⇒ Object
Returns the value of attribute ended_icos.
-
#id ⇒ Object
Returns the value of attribute id.
-
#market_cap_change_percentage_24h_usd ⇒ Object
Returns the value of attribute market_cap_change_percentage_24h_usd.
-
#market_cap_percentage ⇒ Object
Returns the value of attribute market_cap_percentage.
-
#markets ⇒ Object
Returns the value of attribute markets.
-
#name ⇒ Object
Returns the value of attribute name.
-
#ongoing_icos ⇒ Object
Returns the value of attribute ongoing_icos.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
-
#total_market_cap ⇒ Object
Returns the value of attribute total_market_cap.
-
#total_volume ⇒ Object
Returns the value of attribute total_volume.
-
#upcoming_icos ⇒ Object
Returns the value of attribute upcoming_icos.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Attribute Details
#active_cryptocurrencies ⇒ Object
Returns the value of attribute active_cryptocurrencies.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def active_cryptocurrencies @active_cryptocurrencies end |
#data ⇒ Object
Returns the value of attribute data.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def data @data end |
#ended_icos ⇒ Object
Returns the value of attribute ended_icos.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def ended_icos @ended_icos end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def id @id end |
#market_cap_change_percentage_24h_usd ⇒ Object
Returns the value of attribute market_cap_change_percentage_24h_usd.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def market_cap_change_percentage_24h_usd @market_cap_change_percentage_24h_usd end |
#market_cap_percentage ⇒ Object
Returns the value of attribute market_cap_percentage.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def market_cap_percentage @market_cap_percentage end |
#markets ⇒ Object
Returns the value of attribute markets.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def markets @markets end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def name @name end |
#ongoing_icos ⇒ Object
Returns the value of attribute ongoing_icos.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def ongoing_icos @ongoing_icos end |
#symbol ⇒ Object
Returns the value of attribute symbol.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def symbol @symbol end |
#total_market_cap ⇒ Object
Returns the value of attribute total_market_cap.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def total_market_cap @total_market_cap end |
#total_volume ⇒ Object
Returns the value of attribute total_volume.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def total_volume @total_volume end |
#upcoming_icos ⇒ Object
Returns the value of attribute upcoming_icos.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def upcoming_icos @upcoming_icos end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
2 3 4 |
# File 'lib/coingecko/global.rb', line 2 def updated_at @updated_at end |
Class Method Details
.all_coins_list ⇒ Object
14 15 16 |
# File 'lib/coingecko/global.rb', line 14 def self.all_coins_list @@all_coins_list end |
.get_all_coins_list ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/coingecko/global.rb', line 18 def self.get_all_coins_list @@all_coins_list.clear api_get_all = Coingecko::API.get_all_coins counter = 0 while counter < api_get_all.length Coingecko::Global.new.tap do |coin_info| api_get_all[counter].each do |k, v| coin_info.send("#{k}=", v) end @@all_coins_list << coin_info counter += 1 end end end |
.new_from_global ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/coingecko/global.rb', line 6 def self.new_from_global Coingecko::Global.new.tap do |global_attributes| Coingecko::API.get_global_info.each do |k,v| global_attributes.send("#{k}=", v) end end end |