Class: MicroManager::Task
- Inherits:
-
Object
- Object
- MicroManager::Task
- Defined in:
- lib/micro_manager/task.rb
Instance Attribute Summary collapse
-
#completed_on ⇒ Object
readonly
Returns the value of attribute completed_on.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#due ⇒ Object
readonly
Returns the value of attribute due.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #complete ⇒ Object
- #completed? ⇒ Boolean
-
#initialize(description:, due:) ⇒ Task
constructor
A new instance of Task.
Constructor Details
#initialize(description:, due:) ⇒ Task
Returns a new instance of Task.
7 8 9 10 11 |
# File 'lib/micro_manager/task.rb', line 7 def initialize(description:, due:) @description = description @due = due @completed = false end |
Instance Attribute Details
#completed_on ⇒ Object (readonly)
Returns the value of attribute completed_on.
5 6 7 |
# File 'lib/micro_manager/task.rb', line 5 def completed_on @completed_on end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/micro_manager/task.rb', line 5 def description @description end |
#due ⇒ Object (readonly)
Returns the value of attribute due.
5 6 7 |
# File 'lib/micro_manager/task.rb', line 5 def due @due end |
Instance Method Details
#==(other) ⇒ Object
22 23 24 |
# File 'lib/micro_manager/task.rb', line 22 def ==(other) description == other.description && completed? == other.completed? end |
#complete ⇒ Object
13 14 15 16 |
# File 'lib/micro_manager/task.rb', line 13 def complete @completed = true @completed_on = Date.today end |
#completed? ⇒ Boolean
18 19 20 |
# File 'lib/micro_manager/task.rb', line 18 def completed? @completed end |