lib/jm/dsl/link_builder.rb
def create_syncer
        if @get || @set
          accessor = BlockAccessor.new(@get, @set)
        elsif @accessor
          accessor = @accessor
        else
          raise Exception.new("You have to pass an accessor")
        end

        @mapper = Mappers::WhenValue.new(@mapper)

        config = {
          source_accessor: accessor,
          mapper: @mapper,
          target_accessor: HAL::LinkAccessor.new(@rel, @default_value)
        }

        Syncers::CompositeSyncer.new(config)
      end
# Create a link syncer from settings
Create a link syncer from settings
Create a link syncer from settings
def create_syncer
        if @get || @set
          accessor = BlockAccessor.new(@get, @set)
        elsif @accessor
          accessor = @accessor
        else
          raise Exception.new("You have to pass an accessor")
        end
        @mapper = Mappers::WhenValue.new(@mapper)
        config = {
          source_accessor: accessor,
          mapper: @mapper,
          target_accessor: HAL::LinkAccessor.new(@rel, @default_value)
        }
        Syncers::CompositeSyncer.new(config)
      end
def create_syncer if @get || @set accessor = BlockAccessor . new ( @get , @set ) elsif @accessor accessor = @accessor else raise Exception . new ( "You have to pass an accessor" ) end @mapper = Mappers :: WhenValue . new ( @mapper ) config = { source_accessor : accessor , mapper : @mapper , target_accessor : HAL :: LinkAccessor . new ( @rel , @default_value ) } Syncers :: CompositeSyncer . new ( config ) end
Create a link syncer from settings
Create a link syncer from settings