Class: Voom::Presenters::DSL::Components::MultiSelect
Defined Under Namespace
Classes: CheckOption
Instance Attribute Summary
Attributes inherited from Select
#full_width, #options, #outlined, #required
Attributes inherited from Input
Attributes inherited from EventBase
Attributes included from Voom::Presenters::DSL::Components::Mixins::Event
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
- #check_option(**attribs, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ MultiSelect
constructor
A new instance of MultiSelect.
Methods inherited from Select
#hint, #icon, #label, #option, #value
Methods inherited from Input
Methods included from Voom::Presenters::DSL::Components::Mixins::Tooltips
Methods included from Voom::Presenters::DSL::Components::Mixins::Event
Methods inherited from Base
Methods included from Pluggable
#include_plugins, #plugin, #plugin_module
Methods included from Voom::Presenters::DSL::Components::Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ MultiSelect
Returns a new instance of MultiSelect.
7 8 9 10 11 12 13 14 |
# File 'lib/voom/presenters/dsl/components/multi_select.rb', line 7 def initialize(**attribs_, &block) super(type: :multi_select, **attribs_, &block) @required = attribs.delete(:required) @full_width = attribs.delete(:full_width){ true } @outlined = attribs.delete(:outlined){ true } @options = [] end |
Instance Method Details
#check_option(**attribs, &block) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/voom/presenters/dsl/components/multi_select.rb', line 16 def check_option(**attribs, &block) @options << CheckOption.new(parent: self, name: @name, tag: @tag, **attribs.delete_if{ |k,v| [:tag, :name].include?(k) }, &block) end |