Class: Voom::Presenters::DSL::Components::Actions::Base
- Defined in:
- lib/voom/presenters/dsl/components/actions/base.rb
Direct Known Subclasses
Autocomplete, Clear, CloseDialog, Deletes, Dialog, Loads, Navigates, PostMessage, Posts, PromptIfDirty, Remove, Replaces, Snackbar, Stepper, ToggleDisabled, ToggleVisibility, Updates
Instance Attribute Summary collapse
-
#dynamic_params ⇒ Object
readonly
Options are used by the actions Params are passed by the user.
-
#options ⇒ Object
readonly
Options are used by the actions Params are passed by the user.
-
#params ⇒ Object
readonly
Options are used by the actions Params are passed by the user.
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
-
#initialize(type:, **attribs_, &block) ⇒ Base
constructor
A new instance of Base.
- #url ⇒ 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(type:, **attribs_, &block) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 17 18 19 |
# File 'lib/voom/presenters/dsl/components/actions/base.rb', line 11 def initialize(type:, **attribs_, &block) super(type: type, **attribs_, &block) @options = {} _params_ = attribs.delete(:params) {{}} @dynamic_params = extract_dynamic_params(_params_) @params = extract_params(_params_) @url = nil end |
Instance Attribute Details
#dynamic_params ⇒ Object (readonly)
Options are used by the actions Params are passed by the user
9 10 11 |
# File 'lib/voom/presenters/dsl/components/actions/base.rb', line 9 def dynamic_params @dynamic_params end |
#options ⇒ Object (readonly)
Options are used by the actions Params are passed by the user
9 10 11 |
# File 'lib/voom/presenters/dsl/components/actions/base.rb', line 9 def @options end |
#params ⇒ Object (readonly)
Options are used by the actions Params are passed by the user
9 10 11 |
# File 'lib/voom/presenters/dsl/components/actions/base.rb', line 9 def params @params end |
Instance Method Details
#url ⇒ Object
21 22 23 |
# File 'lib/voom/presenters/dsl/components/actions/base.rb', line 21 def url @parent.router.url(render: [:presenter], command: [:path], context: params) end |