Class: App42::Shopping::Category

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(catalogue) ⇒ Category

This is a constructor that takes no parameter



35
36
37
# File 'lib/shopping/Catalogue.rb', line 35

def initialize(catalogue)
  catalogue.categoryList.push(self)
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



25
26
27
# File 'lib/shopping/Catalogue.rb', line 25

def description
  @description
end

#itemListObject

Returns the value of attribute itemList.



25
26
27
# File 'lib/shopping/Catalogue.rb', line 25

def itemList
  @itemList
end

#nameObject

Returns the value of attribute name.



25
26
27
# File 'lib/shopping/Catalogue.rb', line 25

def name
  @name
end

Instance Method Details

#to_sObject

Returns the Cart Response in JSON format.

Returns:

  • the response in JSON format.



45
46
47
# File 'lib/shopping/Catalogue.rb', line 45

def to_s
  return "name : #{@name}" + "description : #{@description}";
end