Class: Yafin::Quote
- Inherits:
-
Object
- Object
- Yafin::Quote
- Defined in:
- lib/yafin/quote.rb
Instance Attribute Summary collapse
-
#change ⇒ Object
Returns the value of attribute change.
-
#change_percent ⇒ Object
Returns the value of attribute change_percent.
-
#exchange ⇒ Object
Returns the value of attribute exchange.
-
#last_trade ⇒ Object
Returns the value of attribute last_trade.
-
#name ⇒ Object
Returns the value of attribute name.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
Instance Method Summary collapse
-
#initialize(args = []) ⇒ Quote
constructor
A new instance of Quote.
- #to_s ⇒ Object
Constructor Details
#initialize(args = []) ⇒ Quote
Returns a new instance of Quote.
4 5 6 7 8 9 10 11 |
# File 'lib/yafin/quote.rb', line 4 def initialize args=[] self.symbol = args[0] self.name = args[1] self.last_trade = args[2] self.change = args[3] self.change_percent = args[4] self.exchange = args[5] end |
Instance Attribute Details
#change ⇒ Object
Returns the value of attribute change.
2 3 4 |
# File 'lib/yafin/quote.rb', line 2 def change @change end |
#change_percent ⇒ Object
Returns the value of attribute change_percent.
2 3 4 |
# File 'lib/yafin/quote.rb', line 2 def change_percent @change_percent end |
#exchange ⇒ Object
Returns the value of attribute exchange.
2 3 4 |
# File 'lib/yafin/quote.rb', line 2 def exchange @exchange end |
#last_trade ⇒ Object
Returns the value of attribute last_trade.
2 3 4 |
# File 'lib/yafin/quote.rb', line 2 def last_trade @last_trade end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/yafin/quote.rb', line 2 def name @name end |
#symbol ⇒ Object
Returns the value of attribute symbol.
2 3 4 |
# File 'lib/yafin/quote.rb', line 2 def symbol @symbol end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'lib/yafin/quote.rb', line 13 def to_s "Symbol: #{symbol} Name: #{name} Last trade: #{last_trade} Change: #{change} Change %: #{change_percent} Exchange: #{exchange}" end |