Class: ParamsKeeper::UrlFor
- Inherits:
-
Object
- Object
- ParamsKeeper::UrlFor
- Defined in:
- lib/params_keeper/url_for.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(caller, controller, url_options) ⇒ UrlFor
constructor
A new instance of UrlFor.
Constructor Details
#initialize(caller, controller, url_options) ⇒ UrlFor
Returns a new instance of UrlFor.
5 6 7 8 9 |
# File 'lib/params_keeper/url_for.rb', line 5 def initialize(caller, controller, ) @caller = caller @controller = controller @url_options = end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/params_keeper/url_for.rb', line 11 def call return if @controller.class.keep_params_configs.blank? resolver = ParamsKeeper::Resolver.new(@controller, @url_options) params = resolver.call return if params.blank? base_url_for(resolver..reverse_merge(params)) end |