class Remap::Constructor

Public Instance Methods

call(state) click to toggle source

Ensures {#target} responds to {#method} Returns an error state unless above is true

@param state [State]

@return [State]

# File lib/remap/constructor.rb, line 17
def call(state)
  state.tap do
    unless target.respond_to?(id)
      raise ArgumentError, "Target [#{target}] does not respond to [#{id}]"
    end
  end
end
to_proc() click to toggle source

@return [Proc]

# File lib/remap/constructor.rb, line 26
def to_proc
  method(:call).to_proc
end

Private Instance Methods

id() click to toggle source

@return [Symbol]

# File lib/remap/constructor.rb, line 33
def id
  attributes.fetch(:method)
end