Class: App42::Shopping::Category
- Inherits:
-
Object
- Object
- App42::Shopping::Category
- Defined in:
- lib/shopping/Catalogue.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#itemList ⇒ Object
Returns the value of attribute itemList.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(catalogue) ⇒ Category
constructor
This is a constructor that takes no parameter.
-
#to_s ⇒ Object
Returns the Cart Response in JSON format.
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
#description ⇒ Object
Returns the value of attribute description.
25 26 27 |
# File 'lib/shopping/Catalogue.rb', line 25 def description @description end |
#itemList ⇒ Object
Returns the value of attribute itemList.
25 26 27 |
# File 'lib/shopping/Catalogue.rb', line 25 def itemList @itemList end |
#name ⇒ Object
Returns the value of attribute name.
25 26 27 |
# File 'lib/shopping/Catalogue.rb', line 25 def name @name end |
Instance Method Details
#to_s ⇒ Object
Returns the Cart Response in JSON format.
45 46 47 |
# File 'lib/shopping/Catalogue.rb', line 45 def to_s return "name : #{@name}" + "description : #{@description}"; end |