Class: Voom::Presenters::DSL::Components::Chipset
- Includes:
- Mixins::Chips
- Defined in:
- lib/voom/presenters/dsl/components/chipset.rb
Constant Summary collapse
- VALID_VARIANTS =
%i[choice filter input].freeze
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#variant ⇒ Object
readonly
Returns the value of attribute variant.
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
-
#initialize(chipset_variant = nil, **attribs_, &block) ⇒ Chipset
constructor
A new instance of Chipset.
Methods included from Mixins::Chips
Methods included from Mixins::Append
Methods included from Mixins::Event
Methods inherited from Base
Methods included from Pluggable
#include_plugins, #plugin, #plugin_module
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(chipset_variant = nil, **attribs_, &block) ⇒ Chipset
Returns a new instance of Chipset.
11 12 13 14 15 16 |
# File 'lib/voom/presenters/dsl/components/chipset.rb', line 11 def initialize(chipset_variant = nil, **attribs_, &block) super(type: :chipset, **attribs_, &block) @variant = validate_variant(chipset_variant) @components = [] end |
Instance Attribute Details
#components ⇒ Object (readonly)
Returns the value of attribute components.
7 8 9 |
# File 'lib/voom/presenters/dsl/components/chipset.rb', line 7 def components @components end |
#variant ⇒ Object (readonly)
Returns the value of attribute variant.
7 8 9 |
# File 'lib/voom/presenters/dsl/components/chipset.rb', line 7 def variant @variant end |