Class: Georgia::ListFacetPresenter

Inherits:
Presenter
  • Object
show all
Defined in:
app/presenters/georgia/list_facet_presenter.rb

Instance Attribute Summary collapse

Attributes inherited from Presenter

#view_context

Instance Method Summary collapse

Constructor Details

#initialize(view_context, list, param, options = {}) ⇒ ListFacetPresenter

Returns a new instance of ListFacetPresenter.



6
7
8
9
10
11
# File 'app/presenters/georgia/list_facet_presenter.rb', line 6

def initialize view_context, list, param, options={}
  super
  @list = list
  @param = param
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Georgia::Presenter

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



4
5
6
# File 'app/presenters/georgia/list_facet_presenter.rb', line 4

def list
  @list
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'app/presenters/georgia/list_facet_presenter.rb', line 4

def options
  @options
end

#paramObject (readonly)

Returns the value of attribute param.



4
5
6
# File 'app/presenters/georgia/list_facet_presenter.rb', line 4

def param
  @param
end

Instance Method Details

#to_sObject



13
14
15
16
17
18
19
# File 'app/presenters/georgia/list_facet_presenter.rb', line 13

def to_s
  output = ActiveSupport::SafeBuffer.new
  list.each do |text|
    output << link_to(text, url_for(merged_params(text)), class: 'label label-default') unless active?(text)
  end
  output
end