Class: GreenButtonData::Parser::LocalTimeParameters
- Inherits:
-
Object
- Object
- GreenButtonData::Parser::LocalTimeParameters
show all
- Includes:
- Dst, Utilities, SAXMachine
- Defined in:
- lib/green-button-data/parser/local_time_parameters.rb
Constant Summary
Constants included
from Dst
Dst::BITMASK_DAY_OF_MONTH, Dst::BITMASK_DAY_OF_WEEK, Dst::BITMASK_DST_RULE, Dst::BITMASK_HOUR, Dst::BITMASK_MONTH, Dst::BITMASK_SECOND, Dst::BITSHIFT_DAY_OF_MONTH, Dst::BITSHIFT_DAY_OF_WEEK, Dst::BITSHIFT_DST_RULE, Dst::BITSHIFT_HOUR, Dst::BITSHIFT_MONTH
Instance Method Summary
collapse
Methods included from Utilities
#attributes_to_hash, #class_from_name, #epoch_to_time, #first_sunday_of, #last_weekday_of, #normalize_epoch, #nth_weekday_of, #parse_datetime, #weekday_offset
Methods included from Dst
#byte_to_dst_datetime, #dst_datetime, #validate_dst_rules
Instance Method Details
#dst_ends_at(year = Time.now.year) ⇒ Object
20
21
22
|
# File 'lib/green-button-data/parser/local_time_parameters.rb', line 20
def dst_ends_at(year = Time.now.year)
byte_to_dst_datetime @dst_end_rule, year
end
|
#dst_starts_at(year = Time.now.year) ⇒ Object
16
17
18
|
# File 'lib/green-button-data/parser/local_time_parameters.rb', line 16
def dst_starts_at(year = Time.now.year)
byte_to_dst_datetime @dst_start_rule, year
end
|
#total_offset ⇒ Object
27
28
29
|
# File 'lib/green-button-data/parser/local_time_parameters.rb', line 27
def total_offset
@dst_offset + @tz_offset
end
|
#total_offset_hours ⇒ Object
31
32
33
|
# File 'lib/green-button-data/parser/local_time_parameters.rb', line 31
def total_offset_hours
total_offset / 3600
end
|