Class: Voom::Presenters::DSL::Components::Actions::Replaces

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

Instance Attribute Summary

Attributes inherited from Base

#dynamic_params, #options, #params

Attributes inherited from Base

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

Instance Method Summary collapse

Methods included from Namespace

#_expand_namespace_

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) ⇒ Replaces

Returns a new instance of Replaces.



9
10
11
12
13
14
# File 'lib/voom/presenters/dsl/components/actions/replaces.rb', line 9

def initialize(**attribs_, &block)
  super(type: :replaces, **attribs_, &block)
  option_value = attribs.delete(:ignore_input_values) { :not_found }
  @options.merge!(ignore_input_values: option_value) unless option_value == :not_found
  @host = @params.fetch(:host, false)
end

Instance Method Details

#urlObject



16
17
18
19
# File 'lib/voom/presenters/dsl/components/actions/replaces.rb', line 16

def url
  presenter = _expand_namespace_(options[:presenter], namespace)
  @parent.router.url(render: presenter, command: options[:path], context: params, host: @host)
end