Class: GroceryList::Item
- Inherits:
-
Object
- Object
- GroceryList::Item
- Defined in:
- lib/grocery_list/item.rb
Instance Attribute Summary collapse
-
#item_name ⇒ Object
readonly
Returns the value of attribute item_name.
Instance Method Summary collapse
- #==(y) ⇒ Object
-
#initialize(item_name) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(item_name) ⇒ Item
Returns a new instance of Item.
5 6 7 |
# File 'lib/grocery_list/item.rb', line 5 def initialize(item_name) @item_name = item_name end |
Instance Attribute Details
#item_name ⇒ Object (readonly)
Returns the value of attribute item_name.
3 4 5 |
# File 'lib/grocery_list/item.rb', line 3 def item_name @item_name end |
Instance Method Details
#==(y) ⇒ Object
9 10 11 |
# File 'lib/grocery_list/item.rb', line 9 def ==(y) y.item_name == @item_name end |