Class: Versed::Task
- Inherits:
-
Object
- Object
- Versed::Task
- Defined in:
- lib/versed/task.rb
Instance Attribute Summary collapse
-
#category_id ⇒ Object
Returns the value of attribute category_id.
-
#date ⇒ Object
Returns the value of attribute date.
-
#time_scheduled ⇒ Object
Returns the value of attribute time_scheduled.
-
#time_spent ⇒ Object
Returns the value of attribute time_spent.
Instance Method Summary collapse
-
#initialize(category_id, date) ⇒ Task
constructor
A new instance of Task.
- #time_scheduled? ⇒ Boolean
- #time_spent? ⇒ Boolean
- #to_hash ⇒ Object
Constructor Details
#initialize(category_id, date) ⇒ Task
Returns a new instance of Task.
5 6 7 8 |
# File 'lib/versed/task.rb', line 5 def initialize(category_id, date) @category_id = category_id @date = date end |
Instance Attribute Details
#category_id ⇒ Object
Returns the value of attribute category_id.
3 4 5 |
# File 'lib/versed/task.rb', line 3 def category_id @category_id end |
#date ⇒ Object
Returns the value of attribute date.
3 4 5 |
# File 'lib/versed/task.rb', line 3 def date @date end |
#time_scheduled ⇒ Object
Returns the value of attribute time_scheduled.
3 4 5 |
# File 'lib/versed/task.rb', line 3 def time_scheduled @time_scheduled end |
#time_spent ⇒ Object
Returns the value of attribute time_spent.
3 4 5 |
# File 'lib/versed/task.rb', line 3 def time_spent @time_spent end |
Instance Method Details
#time_scheduled? ⇒ Boolean
30 31 32 |
# File 'lib/versed/task.rb', line 30 def time_scheduled? self.time_scheduled && self.time_scheduled > 0 end |
#time_spent? ⇒ Boolean
26 27 28 |
# File 'lib/versed/task.rb', line 26 def time_spent? self.time_spent && self.time_spent > 0 end |
#to_hash ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/versed/task.rb', line 10 def to_hash { "time_spent" => self.time_spent.to_s, "time_scheduled" => self.time_scheduled.to_s, "style" => style } end |