Sha256: d71f6b523af4ba85355ff2597309d3719c6d522651b7ff498073c9d90535244b

Contents?: true

Size: 846 Bytes

Versions: 4

Compression:

Stored size: 846 Bytes

Contents

module Dynomite::Item::Query::Params::Function
  class AttributeType < Base
    def filter_expression
      filter_expression = []
      @query[:attribute_type].each do |attribute_type|
        path, type = attribute_type[:path], attribute_type[:type]
        path = normalize_expression_path(path)
        type = type_map(type)
        filter_expression << "attribute_type(#{path}, :#{type})"
      end
      filter_expression
    end

    def attribute_names
      paths = @query[:attribute_type].map { |attribute_type| attribute_type[:path] }
      build_attribute_names_with_dot_paths(paths)
    end

    def attribute_values
      values = {}
      @query[:attribute_type].each do |attribute_type|
        type = attribute_type[:type]
        type = type_map(type)
        values[":#{type}"] = type
      end
      values
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dynomite-2.0.3 lib/dynomite/item/query/params/function/attribute_type.rb
dynomite-2.0.2 lib/dynomite/item/query/params/function/attribute_type.rb
dynomite-2.0.1 lib/dynomite/item/query/params/function/attribute_type.rb
dynomite-2.0.0 lib/dynomite/item/query/params/function/attribute_type.rb