Class: Tesco::Groceries::Shelf

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#aisleObject (readonly)

Returns the value of attribute aisle.



433
434
435
# File 'lib/tesco.rb', line 433

def aisle
  @aisle
end

#aisle_idObject (readonly)

Returns the value of attribute aisle_id.



433
434
435
# File 'lib/tesco.rb', line 433

def aisle_id
  @aisle_id
end

#departmentObject (readonly)

Returns the value of attribute department.



433
434
435
# File 'lib/tesco.rb', line 433

def department
  @department
end

#nameObject (readonly)

Returns the value of attribute name.



433
434
435
# File 'lib/tesco.rb', line 433

def name
  @name
end

Instance Method Details

#inspectObject



445
446
447
# File 'lib/tesco.rb', line 445

def inspect
  "#{@name} Shelf"
end

#productsObject



441
442
443
# File 'lib/tesco.rb', line 441

def products
  @api.products_by_category(@id)
end