Class: Blacklight::ConstraintPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/blacklight/constraint_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(facet_item_presenter:, field_label:) ⇒ ConstraintPresenter

Returns a new instance of ConstraintPresenter.



5
6
7
8
# File 'app/presenters/blacklight/constraint_presenter.rb', line 5

def initialize(facet_item_presenter:, field_label:)
  @facet_item_presenter = facet_item_presenter
  @field_label = field_label
end

Instance Attribute Details

#facet_item_presenterObject

Returns the value of attribute facet_item_presenter.



10
11
12
# File 'app/presenters/blacklight/constraint_presenter.rb', line 10

def facet_item_presenter
  @facet_item_presenter
end

#field_labelObject

Returns the value of attribute field_label.



10
11
12
# File 'app/presenters/blacklight/constraint_presenter.rb', line 10

def field_label
  @field_label
end

Instance Method Details

#constraint_labelString

Get the displayable version of the facet’s value for use in e.g. the constraints widget

Returns:

  • (String)


18
19
20
# File 'app/presenters/blacklight/constraint_presenter.rb', line 18

def constraint_label
  facet_item_presenter.label
end