Class: Stock

Inherits:
Object
  • Object
show all
Includes:
ArgumentProcessor
Defined in:
lib/stock.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ArgumentProcessor

#process_args

Constructor Details

#initialize(args = {}) ⇒ Stock

Returns a new instance of Stock.



6
7
8
9
# File 'lib/stock.rb', line 6

def initialize(args = {})
  process_args(args)
  symbol.upcase! if symbol
end

Instance Attribute Details

#priceObject

Returns the value of attribute price.



4
5
6
# File 'lib/stock.rb', line 4

def price
  @price
end

#symbolObject

Returns the value of attribute symbol.



4
5
6
# File 'lib/stock.rb', line 4

def symbol
  @symbol
end

Instance Method Details

#==(other) ⇒ Object



11
12
13
# File 'lib/stock.rb', line 11

def ==(other)
  symbol == other.symbol
end