Class: Yafin::Quote

Inherits:
Object
  • Object
show all
Defined in:
lib/yafin/quote.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#changeObject

Returns the value of attribute change.



2
3
4
# File 'lib/yafin/quote.rb', line 2

def change
  @change
end

#change_percentObject

Returns the value of attribute change_percent.



2
3
4
# File 'lib/yafin/quote.rb', line 2

def change_percent
  @change_percent
end

#exchangeObject

Returns the value of attribute exchange.



2
3
4
# File 'lib/yafin/quote.rb', line 2

def exchange
  @exchange
end

#last_tradeObject

Returns the value of attribute last_trade.



2
3
4
# File 'lib/yafin/quote.rb', line 2

def last_trade
  @last_trade
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/yafin/quote.rb', line 2

def name
  @name
end

#symbolObject

Returns the value of attribute symbol.



2
3
4
# File 'lib/yafin/quote.rb', line 2

def symbol
  @symbol
end

Instance Method Details

#to_sObject



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