Class: Lifeapi::Query_activity

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#durationObject

Returns the value of attribute duration.



88
89
90
# File 'lib/lifeapi.rb', line 88

def duration
  @duration
end

#end_timeObject

Returns the value of attribute end_time.



88
89
90
# File 'lib/lifeapi.rb', line 88

def end_time
  @end_time
end

#self_typeObject

Returns the value of attribute self_type.



88
89
90
# File 'lib/lifeapi.rb', line 88

def self_type
  @self_type
end

#start_timeObject

Returns the value of attribute start_time.



88
89
90
# File 'lib/lifeapi.rb', line 88

def start_time
  @start_time
end