Class: ParamsKeeper::Resolver
- Inherits:
-
Object
- Object
- ParamsKeeper::Resolver
- Defined in:
- lib/params_keeper/resolver.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(controller, url_options) ⇒ Resolver
constructor
A new instance of Resolver.
- #url_options_hash ⇒ Object
Constructor Details
#initialize(controller, url_options) ⇒ Resolver
Returns a new instance of Resolver.
5 6 7 8 9 |
# File 'lib/params_keeper/resolver.rb', line 5 def initialize(controller, ) @controller = controller @url_options = @cache = {} end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/params_keeper/resolver.rb', line 11 def call return {} if configs.blank? || configs.each_with_object({}) do |config, params| if target_config?(config) params.merge!(extract_params(config)) end end end |
#url_options_hash ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/params_keeper/resolver.rb', line 21 def if @url_options.is_a?(Hash) @url_options else recognize_path(base_url_for(@url_options)) end end |