Class: Holidays::Finder::Context::ParseOptions
- Inherits:
-
Object
- Object
- Holidays::Finder::Context::ParseOptions
- Defined in:
- lib/holidays/finder/context/parse_options.rb
Instance Method Summary collapse
-
#call(*options) ⇒ Object
Returns [(arr)regions, (bool)observed, (bool)informal].
-
#initialize(regions_repo, region_validator, definition_loader) ⇒ ParseOptions
constructor
A new instance of ParseOptions.
Constructor Details
#initialize(regions_repo, region_validator, definition_loader) ⇒ ParseOptions
Returns a new instance of ParseOptions.
5 6 7 8 9 |
# File 'lib/holidays/finder/context/parse_options.rb', line 5 def initialize(regions_repo, region_validator, definition_loader) @regions_repo = regions_repo @region_validator = region_validator @definition_loader = definition_loader end |
Instance Method Details
#call(*options) ⇒ Object
Returns [(arr)regions, (bool)observed, (bool)informal]
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/holidays/finder/context/parse_options.rb', line 12 def call(*) .flatten! #TODO This is garbage. These two deletes MUST come before the # parse_regions call, otherwise it thinks that :observed and :informal # are regions to parse. We should be splitting these things out. observed = .delete(:observed) ? true : false informal = .delete(:informal) ? true : false regions = parse_regions!() return regions, observed, informal end |