Class: Sensor::TimeRange

Inherits:
Object
  • Object
show all
Defined in:
lib/sensor/time_range.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_date, end_date) ⇒ TimeRange

Returns a new instance of TimeRange.



6
7
8
9
# File 'lib/sensor/time_range.rb', line 6

def initialize(start_date, end_date)
  @start = timify(start_date)
  @end = timify(end_date, true)
end

Instance Attribute Details

#endObject (readonly)

Returns the value of attribute end.



5
6
7
# File 'lib/sensor/time_range.rb', line 5

def end
  @end
end

#startObject (readonly)

Returns the value of attribute start.



5
6
7
# File 'lib/sensor/time_range.rb', line 5

def start
  @start
end

Instance Method Details

#end_dateObject



15
16
17
# File 'lib/sensor/time_range.rb', line 15

def end_date
  datify(@end)
end

#start_dateObject



11
12
13
# File 'lib/sensor/time_range.rb', line 11

def start_date
  datify(@start)
end