Class: Voom::Presenters::DSL::Components::Lists::Actions

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

Instance Attribute Summary

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

Returns a new instance of Actions.



7
8
9
10
11
# File 'lib/voom/presenters/dsl/components/lists/actions.rb', line 7

def initialize(actions, **attribs_, &block)
  @actions = actions
  super(type: :actions, **attribs_, &block)
  expand!
end

Instance Method Details

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



50
51
52
53
54
# File 'lib/voom/presenters/dsl/components/lists/actions.rb', line 50

def button(text=nil, **attribs, &block)
  action = Lists::Action.new(parent: self)
  action.button(text, **attribs, &block)
  @actions << action
end

#checkbox(**attribs, &block) ⇒ Object



26
27
28
29
30
# File 'lib/voom/presenters/dsl/components/lists/actions.rb', line 26

def checkbox(**attribs, &block)
  action = Lists::Action.new(parent: self)
  action.checkbox(**attribs, &block)
  @actions << action
end

#icon(icon = nil, **attribs, &block) ⇒ Object



13
14
15
16
17
# File 'lib/voom/presenters/dsl/components/lists/actions.rb', line 13

def icon(icon=nil, **attribs, &block)
  action = Lists::Action.new(parent: self)
  action.icon(icon, **attribs, &block)
  @actions << action
end

#icon_toggle(icon = nil, **attribs, &block) ⇒ Object



44
45
46
47
48
# File 'lib/voom/presenters/dsl/components/lists/actions.rb', line 44

def icon_toggle(icon=nil, **attribs, &block)
  action = Lists::Action.new(parent: self)
  action.icon_toggle(icon, **attribs, &block)
  @actions << action
end


20
21
22
23
24
# File 'lib/voom/presenters/dsl/components/lists/actions.rb', line 20

def menu(**attribs, &block)
  action = Lists::Action.new(parent: self)
  action.menu(**attribs, &block)
  @actions << action
end

#radio_button(**attribs, &block) ⇒ Object



32
33
34
35
36
# File 'lib/voom/presenters/dsl/components/lists/actions.rb', line 32

def radio_button(**attribs, &block)
  action = Lists::Action.new(parent: self)
  action.radio_button(**attribs, &block)
  @actions << action
end

#switch(**attribs, &block) ⇒ Object



38
39
40
41
42
# File 'lib/voom/presenters/dsl/components/lists/actions.rb', line 38

def switch(**attribs, &block)
  action = Lists::Action.new(parent: self)
  action.switch(**attribs, &block)
  @actions << action
end