Class: Event
- Inherits:
-
Object
- Object
- Event
- Defined in:
- lib/repo_timetracker/event.rb
Instance Attribute Summary collapse
-
#following_time_spent ⇒ Object
Returns the value of attribute following_time_spent.
-
#string ⇒ Object
Returns the value of attribute string.
-
#time_recorded ⇒ Object
Returns the value of attribute time_recorded.
Instance Method Summary collapse
- #==(other_event) ⇒ Object
- #following_time_spent_working? ⇒ Boolean
-
#initialize(string, following_time_spent = nil) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(string, following_time_spent = nil) ⇒ Event
Returns a new instance of Event.
4 5 6 7 8 |
# File 'lib/repo_timetracker/event.rb', line 4 def initialize(string, following_time_spent = nil) @string = string @time_recorded = Time.now @following_time_spent = following_time_spent || :working end |
Instance Attribute Details
#following_time_spent ⇒ Object
Returns the value of attribute following_time_spent.
2 3 4 |
# File 'lib/repo_timetracker/event.rb', line 2 def following_time_spent @following_time_spent end |
#string ⇒ Object
Returns the value of attribute string.
2 3 4 |
# File 'lib/repo_timetracker/event.rb', line 2 def string @string end |
#time_recorded ⇒ Object
Returns the value of attribute time_recorded.
2 3 4 |
# File 'lib/repo_timetracker/event.rb', line 2 def time_recorded @time_recorded end |
Instance Method Details
#==(other_event) ⇒ Object
14 15 16 17 18 |
# File 'lib/repo_timetracker/event.rb', line 14 def ==(other_event) @string == other_event.string and @time_recorded == other_event.time_recorded and @following_time_spent == other_event.following_time_spent end |
#following_time_spent_working? ⇒ Boolean
10 11 12 |
# File 'lib/repo_timetracker/event.rb', line 10 def following_time_spent_working? following_time_spent == :working end |