Sha256: 414734a405b0261316ba2122c12b6abe7b02edde254ca66663a5dcb481a8737a

Contents?: true

Size: 579 Bytes

Versions: 3

Compression:

Stored size: 579 Bytes

Contents

module Dynomite
  module Types
    TYPE_MAP = {
      string: 'S',
      number: 'N',
      binary: 'B',
      boolean: 'BOOL',
      null: 'NULL',
      map: 'M',
      list: 'L',
      string_set: 'SS',
      number_set: 'NS',
      binary_set: 'BS',
    }

    # https://rubyonjets.com/docs/database/dynamodb/types/
    # https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypeDescriptors
    def type_map(attribute_type)
      TYPE_MAP[attribute_type.to_s.downcase.to_sym] || attribute_type
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dynomite-2.0.2 lib/dynomite/types.rb
dynomite-2.0.1 lib/dynomite/types.rb
dynomite-2.0.0 lib/dynomite/types.rb