Class: Dynomite::Item::Query::Params::Function::Base

Inherits:
Object
  • Object
show all
Includes:
Helpers, Types
Defined in:
lib/dynomite/item/query/params/function/base.rb

Direct Known Subclasses

AttributeExists, AttributeType, BeginsWith, SizeFn

Constant Summary

Constants included from Types

Types::TYPE_MAP

Instance Method Summary collapse

Methods included from Types

#type_map

Methods included from Helpers

#all_where_field_names, #all_where_fields, #disable_index_for_any_or?, #disable_index_for_consistent_read?, #disable_index_for_not?, #normalize_expression_path, #normalize_project_expression, #query, #scan_required?, #with_where_groups

Constructor Details

#initialize(query) ⇒ Base

Returns a new instance of Base.



6
7
8
# File 'lib/dynomite/item/query/params/function/base.rb', line 6

def initialize(query)
  @query = query
end

Instance Method Details

#attribute_valuesObject



28
29
30
# File 'lib/dynomite/item/query/params/function/base.rb', line 28

def attribute_values
  {}
end

#build_attribute_names_with_dot_paths(paths) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/dynomite/item/query/params/function/base.rb', line 10

def build_attribute_names_with_dot_paths(paths)
  attribute_names = {}
  paths.each do |path|
    fields = path.split('.')
    fields.each do |field|
      if field.starts_with?('#')
        key = field
        value = field[1..-1]
      else
        key = "##{field}"
        value = field
      end
      attribute_names[key] = value
    end
  end
  attribute_names
end