Class: Voom::Presenters::DSL::Components::MultiSelect::CheckOption
Instance Attribute Summary collapse
-
#disabled ⇒ Object
readonly
Returns the value of attribute disabled.
-
#selected ⇒ Object
readonly
Returns the value of attribute selected.
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
- #checkbox(**attributes, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ CheckOption
constructor
A new instance of CheckOption.
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) ⇒ CheckOption
Returns a new instance of CheckOption.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/voom/presenters/dsl/components/multi_select.rb', line 27 def initialize(**attribs_, &block) super(type: :multi_select_option, **attribs_, &block) @value = attribs.delete(:value) @text = attribs.delete(:text) @selected = attribs.delete(:selected){ true } @disabled = attribs.delete(:disabled) self.checkbox(name: "#{attribs[:name]}[]", value: @value, text: @text, tag: tag, checked: @selected, disabled: @disabled, &block) end |
Instance Attribute Details
#disabled ⇒ Object (readonly)
Returns the value of attribute disabled.
25 26 27 |
# File 'lib/voom/presenters/dsl/components/multi_select.rb', line 25 def disabled @disabled end |
#selected ⇒ Object (readonly)
Returns the value of attribute selected.
25 26 27 |
# File 'lib/voom/presenters/dsl/components/multi_select.rb', line 25 def selected @selected end |
Instance Method Details
#checkbox(**attributes, &block) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/voom/presenters/dsl/components/multi_select.rb', line 43 def checkbox(**attributes, &block) return @checkbox if locked? @checkbox = Components::Checkbox.new(parent: self, **attributes, &block) end |