Class: Primer::Forms::AutoComplete
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Primer::Forms::AutoComplete
- Defined in:
- app/lib/primer/forms/auto_complete.rb
Overview
:nodoc:
Constant Summary collapse
- ARGUMENT_TYPES =
%i(keyreq key).freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(input:) ⇒ AutoComplete
constructor
A new instance of AutoComplete.
Methods inherited from BaseComponent
#content, inherited, #input?, #perform_render, #render?, #to_component, #type
Methods included from ActsAsComponent
#base_template_path, #compile!, extended, #renders_templates, #template_root_path
Methods included from ClassNameHelper
Constructor Details
permalink #initialize(input:) ⇒ AutoComplete
Returns a new instance of AutoComplete.
11 12 13 14 |
# File 'app/lib/primer/forms/auto_complete.rb', line 11 def initialize(input:) @input = input @input.merge_input_arguments!(text_field_attributes.deep_symbolize_keys) end |
Class Method Details
permalink .auto_complete_argument_names ⇒ Object
[View source]
16 17 18 19 20 21 |
# File 'app/lib/primer/forms/auto_complete.rb', line 16 def self.auto_complete_argument_names @auto_complete_argument_names ||= Primer::Beta::AutoComplete.instance_method(:initialize) .parameters .filter_map { |(type, param_name)| next param_name if ARGUMENT_TYPES.include?(type) } end |