Class: Arara::Tags::Chipset
- Inherits:
-
ActionView::Helpers::Tags::Base
- Object
- ActionView::Helpers::Tags::Base
- Arara::Tags::Chipset
- Includes:
- ActionView::Helpers::Tags::Placeholderable
- Defined in:
- app/components/arara/tags/chipset.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(object_name, method_name, template_object, options = {}, &block) ⇒ Chipset
constructor
A new instance of Chipset.
- #render ⇒ Object
Constructor Details
#initialize(object_name, method_name, template_object, options = {}, &block) ⇒ Chipset
Returns a new instance of Chipset.
11 12 13 14 |
# File 'app/components/arara/tags/chipset.rb', line 11 def initialize(object_name, method_name, template_object, = {}, &block) @block = block super end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
8 9 10 |
# File 'app/components/arara/tags/chipset.rb', line 8 def block @block end |
Class Method Details
.field_type ⇒ Object
28 29 30 |
# File 'app/components/arara/tags/chipset.rb', line 28 def field_type @field_type ||= name.split("::").last.sub("Field", "").downcase end |
Instance Method Details
#render ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'app/components/arara/tags/chipset.rb', line 16 def render = @options.stringify_keys ["value"] = .fetch("value") { value_before_type_cast } unless field_type == "file" if ["variant"] == :choice ["include_choice_hidden_field"] = true end add_default_name_and_id() @template_object.template.render(Arara::ChipsetComponent, .symbolize_keys, &block) end |