Class: Tudu::Task
- Inherits:
-
Object
- Object
- Tudu::Task
- Defined in:
- lib/task.rb
Overview
Tudu::Task
Instance Attribute Summary collapse
-
#name ⇒ Object
task name [uniq].
-
#type ⇒ Object
task type [todo, doing, done].
Instance Method Summary collapse
- #==(other) ⇒ Object
- #doing? ⇒ Boolean
- #done? ⇒ Boolean
-
#initialize(type, name) ⇒ Task
constructor
init task with setting task type and task name.
- #todo? ⇒ Boolean
Constructor Details
#initialize(type, name) ⇒ Task
init task with setting task type and task name.
12 13 14 |
# File 'lib/task.rb', line 12 def initialize(type, name) @type, @name = type, name end |
Instance Attribute Details
#name ⇒ Object
task name [uniq]
9 10 11 |
# File 'lib/task.rb', line 9 def name @name end |
#type ⇒ Object
task type [todo, doing, done]
7 8 9 |
# File 'lib/task.rb', line 7 def type @type end |
Instance Method Details
#==(other) ⇒ Object
28 29 30 31 |
# File 'lib/task.rb', line 28 def ==(other) return true if name == other.name && type == other.type false end |
#doing? ⇒ Boolean
20 21 22 |
# File 'lib/task.rb', line 20 def doing? @type == 'doings' end |
#done? ⇒ Boolean
24 25 26 |
# File 'lib/task.rb', line 24 def done? @type == 'dones' end |
#todo? ⇒ Boolean
16 17 18 |
# File 'lib/task.rb', line 16 def todo? @type == 'todos' end |