Class: Category
- Inherits:
-
Object
- Object
- Category
- Defined in:
- lib/category.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key, description) ⇒ Category
constructor
A new instance of Category.
- #to_s ⇒ Object
Constructor Details
#initialize(key, description) ⇒ Category
Returns a new instance of Category.
5 6 7 8 |
# File 'lib/category.rb', line 5 def initialize(key, description) @key = key @description = description end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/category.rb', line 3 def description @description end |
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/category.rb', line 3 def key @key end |
Instance Method Details
#to_s ⇒ Object
10 11 12 |
# File 'lib/category.rb', line 10 def to_s "#{@key}: '#{@description}'" end |