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.
Attributes inherited from Base
#attributes, #context, #id, #type
Instance Method Summary collapse
- #button(text = nil, **options, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ Actions
constructor
A new instance of Actions.
Methods inherited from Base
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.
105 106 107 108 109 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 105 def initialize(**attribs_, &block) super(type: :action, **attribs_, &block) @buttons = [] end |
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
103 104 105 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 103 def @buttons end |
Instance Method Details
#button(text = nil, **options, &block) ⇒ Object
111 112 113 114 115 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 111 def (text=nil, **, &block) @buttons << Components::Button.new(parent: self, text: text, context: context, **, &block) end |