Class: Stock
Instance Attribute Summary collapse
-
#price ⇒ Object
Returns the value of attribute price.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(args = {}) ⇒ Stock
constructor
A new instance of Stock.
Methods included from ArgumentProcessor
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
#price ⇒ Object
Returns the value of attribute price.
4 5 6 |
# File 'lib/stock.rb', line 4 def price @price end |
#symbol ⇒ Object
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 |