Class: Remap::Static::Fixed

Inherits:
Concrete
  • Object
show all
Defined in:
lib/remap/static/fixed.rb

Overview

Maps a fixed value to state

Examples:

Map a fixed value to path

class Mapper < Remap::Base
  define do
    set :a, :b, to: value('a value')
  end
end

Mapper.call({}) # => { a: { b: 'a value' } }

Instance Method Summary collapse

Instance Method Details

#call(state) ⇒ State

Set state to #value

Parameters:

Returns:



26
27
28
# File 'lib/remap/static/fixed.rb', line 26

def call(state)
  state.set(value)
end

#valueAny

Returns:

  • (Any)


19
# File 'lib/remap/static/fixed.rb', line 19

attribute :value, Types::Any