Class: Neoneo::Category
- Inherits:
-
Object
- Object
- Neoneo::Category
- Defined in:
- lib/neoneo.rb
Overview
Representation of No Kahuna’s categories for tasks
At the moment it’s a read-only class. So you can’t change the name of a category and then save those change. This is planned for future versions.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#add_task(description, options = {}) ⇒ Object
Adds a task to this category.
-
#initialize(id, name, project) ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize(id, name, project) ⇒ Category
Returns a new instance of Category.
377 378 379 380 381 |
# File 'lib/neoneo.rb', line 377 def initialize(id, name, project) @id = id @name = name @project = project end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
375 376 377 |
# File 'lib/neoneo.rb', line 375 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
375 376 377 |
# File 'lib/neoneo.rb', line 375 def name @name end |
Instance Method Details
#add_task(description, options = {}) ⇒ Object
Adds a task to this category
It works exactly as Project#add_task only with a pre-filled :category option. So please look there for further instructions on how to use it.
387 388 389 390 |
# File 'lib/neoneo.rb', line 387 def add_task(description, = {}) [:category => self] @project.add_task(description, ) end |