Class: Georgia::FacetPresenter
- Defined in:
- app/presenters/georgia/facet_presenter.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
(also: #active?)
readonly
Returns the value of attribute active.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#param ⇒ Object
readonly
Returns the value of attribute param.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Presenter
Instance Method Summary collapse
-
#initialize(view_context, text, param, options = {}) ⇒ FacetPresenter
constructor
A new instance of FacetPresenter.
- #to_s ⇒ Object
Constructor Details
#initialize(view_context, text, param, options = {}) ⇒ FacetPresenter
Returns a new instance of FacetPresenter.
7 8 9 10 11 12 13 |
# File 'app/presenters/georgia/facet_presenter.rb', line 7 def initialize view_context, text, param, ={} super @text = text @param = param @active = .fetch(:active, get_active_state_from_params) @options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Georgia::Presenter
Instance Attribute Details
#active ⇒ Object (readonly) Also known as: active?
Returns the value of attribute active.
4 5 6 |
# File 'app/presenters/georgia/facet_presenter.rb', line 4 def active @active end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'app/presenters/georgia/facet_presenter.rb', line 4 def @options end |
#param ⇒ Object (readonly)
Returns the value of attribute param.
4 5 6 |
# File 'app/presenters/georgia/facet_presenter.rb', line 4 def param @param end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'app/presenters/georgia/facet_presenter.rb', line 4 def text @text end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'app/presenters/georgia/facet_presenter.rb', line 15 def to_s active? ? content_tag(:em, text) : link_to(text, url_for(params.merge(param => text)), class: 'label label-default') end |