Sha256: 6e83de67f4588dbcb231ca9f2bd14ff3a45f6a483155bab190aef813746c624e

Contents?: true

Size: 284 Bytes

Versions: 2

Compression:

Stored size: 284 Bytes

Contents

module Materialist
  module Materializer
    module Internals
      class FieldMapping
        def initialize(key:, as: key)
          @key = key
          @as = as
        end

        def map(resource)
          { @as => resource.dig(@key) }
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
materialist-3.5.0 lib/materialist/materializer/internals/field_mapping.rb
materialist-3.4.0 lib/materialist/materializer/internals/field_mapping.rb