Sha256: 8dce03cc6f1f40c74f8f17288c10943d27992feea6f354c525a9f7baf7f5c551

Contents?: true

Size: 791 Bytes

Versions: 6

Compression:

Stored size: 791 Bytes

Contents

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

            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

            def url
              presenter = _expand_namespace_(options[:presenter], namespace)
              @parent.router.url(render: presenter, command: options[:path], context: params, host: @host)
            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/replaces.rb
voom-presenters-2.1.0 lib/voom/presenters/dsl/components/actions/replaces.rb
voom-presenters-2.0.3 lib/voom/presenters/dsl/components/actions/replaces.rb
voom-presenters-2.0.2 lib/voom/presenters/dsl/components/actions/replaces.rb
voom-presenters-2.0.1 lib/voom/presenters/dsl/components/actions/replaces.rb
voom-presenters-2.0.0 lib/voom/presenters/dsl/components/actions/replaces.rb