Class: CryptoPrice::Coin
- Inherits:
-
Object
- Object
- CryptoPrice::Coin
- Defined in:
- lib/crypto_price/coin.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#change ⇒ Object
Returns the value of attribute change.
-
#marketcap ⇒ Object
Returns the value of attribute marketcap.
-
#name ⇒ Object
Returns the value of attribute name.
-
#price ⇒ Object
Returns the value of attribute price.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
-
#volume ⇒ Object
Returns the value of attribute volume.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(symbol, name, price, change, marketcap) ⇒ Coin
constructor
A new instance of Coin.
Constructor Details
#initialize(symbol, name, price, change, marketcap) ⇒ Coin
Returns a new instance of Coin.
8 9 10 11 12 13 14 15 |
# File 'lib/crypto_price/coin.rb', line 8 def initialize(symbol, name, price, change , marketcap) @symbol = symbol @name = name @price = price @change = change @marketcap = marketcap @@all << self end |
Instance Attribute Details
#change ⇒ Object
Returns the value of attribute change.
4 5 6 |
# File 'lib/crypto_price/coin.rb', line 4 def change @change end |
#marketcap ⇒ Object
Returns the value of attribute marketcap.
4 5 6 |
# File 'lib/crypto_price/coin.rb', line 4 def marketcap @marketcap end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/crypto_price/coin.rb', line 4 def name @name end |
#price ⇒ Object
Returns the value of attribute price.
4 5 6 |
# File 'lib/crypto_price/coin.rb', line 4 def price @price end |
#symbol ⇒ Object
Returns the value of attribute symbol.
4 5 6 |
# File 'lib/crypto_price/coin.rb', line 4 def symbol @symbol end |
#volume ⇒ Object
Returns the value of attribute volume.
4 5 6 |
# File 'lib/crypto_price/coin.rb', line 4 def volume @volume end |
Class Method Details
.all ⇒ Object
17 18 19 |
# File 'lib/crypto_price/coin.rb', line 17 def self.all @@all end |