Class: Voom::Presenters::DSL::Components::Card::Actions
- Defined in:
- lib/voom/presenters/dsl/components/card.rb
Instance Attribute Summary collapse
-
#buttons ⇒ Object
Returns the value of attribute buttons.
-
#switches ⇒ Object
Returns the value of attribute switches.
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
- #button(text = nil, **options, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ Actions
constructor
A new instance of Actions.
- #switch(text = nil, **options, &block) ⇒ Object
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(**attribs_, &block) ⇒ Actions
Returns a new instance of Actions.
110 111 112 113 114 115 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 110 def initialize(**attribs_, &block) super(type: :action, **attribs_, &block) @buttons = [] @switches = [] end |
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
108 109 110 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 108 def @buttons end |
#switches ⇒ Object
Returns the value of attribute switches.
108 109 110 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 108 def switches @switches end |
Instance Method Details
#button(text = nil, **options, &block) ⇒ Object
117 118 119 120 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 117 def (text = nil, **, &block) @buttons << Components::Button.new(parent: self, text: text, **, &block) end |
#switch(text = nil, **options, &block) ⇒ Object
122 123 124 125 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 122 def switch(text = nil, **, &block) @switches << Components::Switch.new(parent: self, text: text, **, &block) end |