Class: Voom::Presenters::DSL::Components::Dialog::Actions

Inherits:
Base
  • Object
show all
Defined in:
lib/voom/presenters/dsl/components/dialog.rb

Instance Attribute Summary collapse

Attributes inherited from Base

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

Instance Method Summary collapse

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(**attribs_, &block) ⇒ Actions

Returns a new instance of Actions.



64
65
66
67
68
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 64

def initialize(**attribs_, &block)
  super(type: :action, **attribs_, &block)
  @buttons = []
  expand!
end

Instance Attribute Details

#buttonsObject

Returns the value of attribute buttons.



62
63
64
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 62

def buttons
  @buttons
end

Instance Method Details

#button(text = nil, **options, &block) ⇒ Object



70
71
72
73
# File 'lib/voom/presenters/dsl/components/dialog.rb', line 70

def button(text = nil, **options, &block)
  @buttons << Components::Button.new(parent: self, text: text,
                                     **options, &block)
end