Class: Voom::Presenters::DSL::Components::Lists::Actions
- Inherits:
-
Base
- Object
- Base
- Voom::Presenters::DSL::Components::Lists::Actions
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
-
#button(text = nil, **attribs, &block) ⇒ Object
-
#checkbox(**attribs, &block) ⇒ Object
-
#icon(icon = nil, **attribs, &block) ⇒ Object
-
#icon_toggle(icon = nil, **attribs, &block) ⇒ Object
-
#initialize(actions, **attribs_, &block) ⇒ Actions
constructor
A new instance of Actions.
-
#menu(**attribs, &block) ⇒ Object
-
#radio_button(**attribs, &block) ⇒ Object
-
#switch(**attribs, &block) ⇒ Object
Methods inherited from Base
#expand!
Methods included from Pluggable
#include_plugins, #plugin, #plugin_module
#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
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 (**attribs, &block)
action = Lists::Action.new(parent: self)
action.(**attribs, &block)
@actions << action
end
|
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
|