Class: Voom::Presenters::Router
- Inherits:
-
Object
- Object
- Voom::Presenters::Router
- Defined in:
- lib/voom/presenters/router.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
Instance Method Summary collapse
-
#initialize(base_url: nil) ⇒ Router
constructor
A new instance of Router.
- #scrub_params(_params_) ⇒ Object
- #url(command: nil, render: nil, host: false, context:) ⇒ Object
Constructor Details
#initialize(base_url: nil) ⇒ Router
Returns a new instance of Router.
9 10 11 |
# File 'lib/voom/presenters/router.rb', line 9 def initialize(base_url: nil) @base_url = base_url end |
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
7 8 9 |
# File 'lib/voom/presenters/router.rb', line 7 def base_url @base_url end |
Instance Method Details
#scrub_params(_params_) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/voom/presenters/router.rb', line 20 def scrub_params(_params_) _params_.delete('captures') _params_.delete('presenter') _params_.delete('action') _params_.delete('errors') _params_ end |
#url(command: nil, render: nil, host: false, context:) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/voom/presenters/router.rb', line 13 def url(command: nil, render: nil, host: false, context:) _params_ = context.dup return build_render_url(render, _params_, host: host) unless command _params_[:redirect]=build_render_url(render, _params_) if render build_command_url(command, _params_) end |