Class: BucketCake::Base::Range

Inherits:
BucketCake::Base show all
Includes:
TimeHelper
Defined in:
lib/bucket_cake/base.rb

Direct Known Subclasses

Facts::Clicks, Facts::Conversions

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TimeHelper

#assert_time, #hour_cursor, #hour_keys, #minute_cursor

Methods inherited from BucketCake::Base

#items

Constructor Details

#initialize(start_time, end_time) ⇒ Range

Returns a new instance of Range.



33
34
35
36
37
38
39
40
# File 'lib/bucket_cake/base.rb', line 33

def initialize(start_time, end_time)
  assert_time(start_time)
  assert_time(end_time)
  raise 'Invalid time: end must be after start' unless end_time > start_time

  @start_time = start_time
  @end_time = end_time
end

Instance Attribute Details

#end_timeObject (readonly)

Returns the value of attribute end_time.



31
32
33
# File 'lib/bucket_cake/base.rb', line 31

def end_time
  @end_time
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



31
32
33
# File 'lib/bucket_cake/base.rb', line 31

def start_time
  @start_time
end