Class: Voom::Presenters::DSL::Components::Actions::Loads

Inherits:
Base
  • Object
show all
Includes:
Namespace
Defined in:
lib/voom/presenters/dsl/components/actions/loads.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) ⇒ Loads

Returns a new instance of Loads.



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

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

Instance Method Details

#urlObject



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

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