Class: GovukPublishingComponents::Presenters::SelectWithSearchHelper
- Inherits:
-
Object
- Object
- GovukPublishingComponents::Presenters::SelectWithSearchHelper
- Includes:
- ActionView::Helpers::FormOptionsHelper
- Defined in:
- lib/govuk_publishing_components/presenters/select_with_search_helper.rb
Instance Attribute Summary collapse
-
#aria ⇒ Object
readonly
Returns the value of attribute aria.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#options_markup ⇒ Object
readonly
Returns the value of attribute options_markup.
-
#selected_options ⇒ Object
readonly
Returns the value of attribute selected_options.
Instance Method Summary collapse
- #css_classes ⇒ Object
-
#initialize(local_assigns) ⇒ SelectWithSearchHelper
constructor
A new instance of SelectWithSearchHelper.
Constructor Details
#initialize(local_assigns) ⇒ SelectWithSearchHelper
Returns a new instance of SelectWithSearchHelper.
21 22 23 24 25 26 27 28 29 |
# File 'lib/govuk_publishing_components/presenters/select_with_search_helper.rb', line 21 def initialize(local_assigns) @select_helper = SelectHelper.new(local_assigns.except(:options, :grouped_options)) @options = local_assigns[:options] @grouped_options = local_assigns[:grouped_options] @include_blank = local_assigns[:include_blank] @selected_options = [] @options_markup = @local_assigns = local_assigns end |
Instance Attribute Details
#aria ⇒ Object (readonly)
Returns the value of attribute aria.
10 11 12 |
# File 'lib/govuk_publishing_components/presenters/select_with_search_helper.rb', line 10 def aria @aria end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/govuk_publishing_components/presenters/select_with_search_helper.rb', line 10 def @options end |
#options_markup ⇒ Object (readonly)
Returns the value of attribute options_markup.
10 11 12 |
# File 'lib/govuk_publishing_components/presenters/select_with_search_helper.rb', line 10 def @options_markup end |
#selected_options ⇒ Object (readonly)
Returns the value of attribute selected_options.
10 11 12 |
# File 'lib/govuk_publishing_components/presenters/select_with_search_helper.rb', line 10 def @selected_options end |
Instance Method Details
#css_classes ⇒ Object
31 32 33 34 35 |
# File 'lib/govuk_publishing_components/presenters/select_with_search_helper.rb', line 31 def css_classes classes = @select_helper.css_classes classes << "gem-c-select-with-search" classes end |