Class: Category

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/category.rb', line 3

def description
  @description
end

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/category.rb', line 3

def key
  @key
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/category.rb', line 10

def to_s
  "#{@key}: '#{@description}'"
end