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

        if @validator
          mapper = Mappers::ValidatedMapper.new(
            @mapper,
            Validators::IdentityValidator.new,
            @validator
          )
        else
          mapper = @mapper
        end

        mapper = Mappers::SinkingMapper.new(mapper, [@name])

        args = {
          source_accessor: accessor,
          mapper: mapper,
          target_accessor: Accessors::HashKeyAccessor.new(@name)
        }

        Syncers::CompositeSyncer.new(**args)
      end
# Create a property syncer from the configuration
#
# @return [JM::Syncer]
Create a property syncer from the configuration
Create a property syncer from the configuration
def create_syncer
        if @get || @set
          accessor = BlockAccessor.new(@get, @set)
        elsif @accessor
          accessor = @accessor
        else
          raise Exception.new("You have to define an accessor")
        end
        if @validator
          mapper = Mappers::ValidatedMapper.new(
            @mapper,
            Validators::IdentityValidator.new,
            @validator
          )
        else
          mapper = @mapper
        end
        mapper = Mappers::SinkingMapper.new(mapper, [@name])
        args = {
          source_accessor: accessor,
          mapper: mapper,
          target_accessor: Accessors::HashKeyAccessor.new(@name)
        }
        Syncers::CompositeSyncer.new(**args)
      end
def create_syncer if @get || @set accessor = BlockAccessor . new ( @get , @set ) elsif @accessor accessor = @accessor else raise Exception . new ( "You have to define an accessor" ) end if @validator mapper = Mappers :: ValidatedMapper . new ( @mapper , Validators :: IdentityValidator . new , @validator ) else mapper = @mapper end mapper = Mappers :: SinkingMapper . new ( mapper , [ @name ] ) args = { source_accessor : accessor , mapper : mapper , target_accessor : Accessors :: HashKeyAccessor . new ( @name ) } Syncers :: CompositeSyncer . new ( ** args ) end
Create a property syncer from the configuration
Create a property syncer from the configuration
None
JM::Syncer