Class: Tesco::Groceries::Shelf
- Inherits:
-
Object
- Object
- Tesco::Groceries::Shelf
- Defined in:
- lib/tesco.rb
Instance Attribute Summary collapse
-
#aisle ⇒ Object
readonly
Returns the value of attribute aisle.
-
#aisle_id ⇒ Object
readonly
Returns the value of attribute aisle_id.
-
#department ⇒ Object
readonly
Returns the value of attribute department.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(api, details) ⇒ Shelf
constructor
No point in creating these by hand.
- #inspect ⇒ Object
- #products ⇒ Object
Constructor Details
#initialize(api, details) ⇒ Shelf
No point in creating these by hand.
435 436 437 438 439 |
# File 'lib/tesco.rb', line 435 def initialize(api,details) # :nodoc: @api = api @id = details['Id'] @name = details['Name'] end |
Instance Attribute Details
#aisle ⇒ Object (readonly)
Returns the value of attribute aisle.
433 434 435 |
# File 'lib/tesco.rb', line 433 def aisle @aisle end |
#aisle_id ⇒ Object (readonly)
Returns the value of attribute aisle_id.
433 434 435 |
# File 'lib/tesco.rb', line 433 def aisle_id @aisle_id end |
#department ⇒ Object (readonly)
Returns the value of attribute department.
433 434 435 |
# File 'lib/tesco.rb', line 433 def department @department end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
433 434 435 |
# File 'lib/tesco.rb', line 433 def name @name end |
Instance Method Details
#inspect ⇒ Object
445 446 447 |
# File 'lib/tesco.rb', line 445 def inspect "#{@name} Shelf" end |
#products ⇒ Object
441 442 443 |
# File 'lib/tesco.rb', line 441 def products @api.products_by_category(@id) end |