Class: BucketCake::Base::Range
- Inherits:
-
BucketCake::Base
- Object
- BucketCake::Base
- BucketCake::Base::Range
- Includes:
- TimeHelper
- Defined in:
- lib/bucket_cake/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#end_time ⇒ Object
readonly
Returns the value of attribute end_time.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
Instance Method Summary collapse
-
#initialize(start_time, end_time) ⇒ Range
constructor
A new instance of Range.
Methods included from TimeHelper
#assert_time, #hour_cursor, #hour_keys, #minute_cursor
Methods inherited from BucketCake::Base
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_time ⇒ Object (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_time ⇒ Object (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 |