Sha256: 2cb70cc3e2a01193bf73c170392b3fa893983c2347a0eb867601457f32d4c2f8

Contents?: true

Size: 942 Bytes

Versions: 6

Compression:

Stored size: 942 Bytes

Contents

module Voom
  module Presenters
    module DSL
      module Components
        module Actions
          class Loads < Actions::Base
            include Namespace

            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

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

            private

            def parse_presenter
              return options[:presenter] if options[:presenter].match(/^https?\:\/\//)
              _expand_namespace_(options[:presenter], namespace).gsub(':', '/')
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
voom-presenters-2.1.2 lib/voom/presenters/dsl/components/actions/loads.rb
voom-presenters-2.1.0 lib/voom/presenters/dsl/components/actions/loads.rb
voom-presenters-2.0.3 lib/voom/presenters/dsl/components/actions/loads.rb
voom-presenters-2.0.2 lib/voom/presenters/dsl/components/actions/loads.rb
voom-presenters-2.0.1 lib/voom/presenters/dsl/components/actions/loads.rb
voom-presenters-2.0.0 lib/voom/presenters/dsl/components/actions/loads.rb