Class: Lifeapi::Query_activity
- Inherits:
-
Object
- Object
- Lifeapi::Query_activity
- Defined in:
- lib/lifeapi.rb
Overview
contains a single query activity needs its own class over regular Activity because it has more info type: the type of activity (run, read, sleep, etc) duration: the duration of the activity in minutes start_time: the time (in 24 hr clock) when the activity was started end_time: the time (in 24 hr clock) when the activity was ended
Instance Attribute Summary collapse
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#self_type ⇒ Object
Returns the value of attribute self_type.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
-
#initialize(type, duration, start_time, end_time) ⇒ Query_activity
constructor
A new instance of Query_activity.
Constructor Details
#initialize(type, duration, start_time, end_time) ⇒ Query_activity
Returns a new instance of Query_activity.
90 91 92 93 94 95 |
# File 'lib/lifeapi.rb', line 90 def initialize(type, duration, start_time, end_time) self.self_type = type self.duration = duration self.start_time = start_time self.end_time = end_time end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
88 89 90 |
# File 'lib/lifeapi.rb', line 88 def duration @duration end |
#end_time ⇒ Object
Returns the value of attribute end_time.
88 89 90 |
# File 'lib/lifeapi.rb', line 88 def end_time @end_time end |
#self_type ⇒ Object
Returns the value of attribute self_type.
88 89 90 |
# File 'lib/lifeapi.rb', line 88 def self_type @self_type end |
#start_time ⇒ Object
Returns the value of attribute start_time.
88 89 90 |
# File 'lib/lifeapi.rb', line 88 def start_time @start_time end |