Class: Voom::Presenters::DSL::Components::Chipset

Inherits:
EventBase
  • Object
show all
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

Attributes inherited from EventBase

#event_parent_id

Attributes included from Mixins::Event

#events

Attributes inherited from Base

#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type

Instance Method Summary collapse

Methods included from Mixins::Chips

#chip

Methods included from Mixins::Append

#<<, #yield_to

Methods included from Mixins::Event

#event

Methods inherited from Base

#expand!

Methods included from Pluggable

#include_plugins, #plugin, #plugin_module

Methods included from Mixins::YieldTo

#yield_to

Methods included from Serializer

#to_hash

Methods included from Lockable

#locked?

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 = []
  expand!
end

Instance Attribute Details

#componentsObject (readonly)

Returns the value of attribute components.



7
8
9
# File 'lib/voom/presenters/dsl/components/chipset.rb', line 7

def components
  @components
end

#variantObject (readonly)

Returns the value of attribute variant.



7
8
9
# File 'lib/voom/presenters/dsl/components/chipset.rb', line 7

def variant
  @variant
end