Class: StockTracker::MockCurrentQuote

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol) ⇒ MockCurrentQuote

Returns a new instance of MockCurrentQuote.



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/stocktracker.rb', line 44

def initialize(symbol)
  self.symbol = symbol.upcase
  self.results =
    {
      :symbol=>"GOOG",
      :name=>"Google Inc.",
      :last_trade=>633.14,
      :date=>"12/23/2011",
      :time=>"4:00pm",
      :change=>"+3.44 - +0.55%",
      :change_points=>3.44,
      :change_percent=>0.55,
      :previous_close=>629.7,
      :open=>632.0,
      :day_high=>634.68,
      :day_low=>630.56,
      :volume=>1453723,
      :day_range=>"630.56 - 634.68",
      :last_trade_with_time=>"Dec 23 - <b>633.14</b>",
      :ticker_trend=>"&nbsp;======&nbsp;",
      :average_daily_volume=>3109540,
      :bid=>632.15,
      :ask=>633.93
    }
end

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



43
44
45
# File 'lib/stocktracker.rb', line 43

def results
  @results
end

#symbolObject

Returns the value of attribute symbol.



43
44
45
# File 'lib/stocktracker.rb', line 43

def symbol
  @symbol
end