Class: Timeframe::Iso8601::Side
- Inherits:
-
Object
- Object
- Timeframe::Iso8601::Side
- Defined in:
- lib/timeframe/iso_8601.rb
Overview
Internal use.
Constant Summary collapse
- EXCLUDED_LAST_DAY =
We add one day because so that it can be excluded per timeframe’s conventions.
86_400
Instance Attribute Summary collapse
-
#date_part ⇒ Object
readonly
Returns the value of attribute date_part.
-
#time_part ⇒ Object
readonly
Returns the value of attribute time_part.
Instance Method Summary collapse
Instance Attribute Details
#date_part ⇒ Object (readonly)
Returns the value of attribute date_part.
30 31 32 |
# File 'lib/timeframe/iso_8601.rb', line 30 def date_part @date_part end |
#time_part ⇒ Object (readonly)
Returns the value of attribute time_part.
31 32 33 |
# File 'lib/timeframe/iso_8601.rb', line 31 def time_part @time_part end |
Instance Method Details
#to_time(counterpart) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/timeframe/iso_8601.rb', line 32 def to_time(counterpart) if date_part.start_with?('P') counterpart.resolve_time(self) + offset + EXCLUDED_LAST_DAY else resolve_time counterpart end end |