class TZInfo::DataSources::ZoneinfoReader
def replace_with_existing_offsets(offsets, annual_rules)
-
(AnnualRules)
- either a new {AnnualRules} instance with either
Parameters:
-
annual_rules
(AnnualRules
) -- the {AnnualRules} instance to check. -
offsets
(Array
) -- an `Array` to search for
def replace_with_existing_offsets(offsets, annual_rules) existing_std_offset = find_existing_offset(offsets, annual_rules.std_offset) existing_dst_offset = find_existing_offset(offsets, annual_rules.dst_offset) if existing_std_offset || existing_dst_offset AnnualRules.new(existing_std_offset || annual_rules.std_offset, existing_dst_offset || annual_rules.dst_offset, annual_rules.dst_start_rule, annual_rules.dst_end_rule) else annual_rules end end