Class: Dynomite::Item::Query::Params::Function::BeginsWith
- Defined in:
- lib/dynomite/item/query/params/function/begins_with.rb
Direct Known Subclasses
Constant Summary
Constants included from Types
Instance Method Summary collapse
- #attribute_names ⇒ Object
- #attribute_values ⇒ Object
- #filter_expression ⇒ Object
-
#query_key ⇒ Object
interface method so Contains < BeginsWith can override.
Methods inherited from Base
#build_attribute_names_with_dot_paths, #initialize
Methods included from Types
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
This class inherits a constructor from Dynomite::Item::Query::Params::Function::Base
Instance Method Details
#attribute_names ⇒ Object
13 14 15 16 |
# File 'lib/dynomite/item/query/params/function/begins_with.rb', line 13 def attribute_names paths = @query[query_key].map { |begins_with| begins_with[:path] } build_attribute_names_with_dot_paths(paths) end |
#attribute_values ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/dynomite/item/query/params/function/begins_with.rb', line 18 def attribute_values values = {} @query[query_key].each do |begins_with| path, substr = begins_with[:path], begins_with[:substr] values[":#{substr}"] = substr end values end |
#filter_expression ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/dynomite/item/query/params/function/begins_with.rb', line 3 def filter_expression filter_expression = [] @query[query_key].each do |begins_with| path, substr = begins_with[:path], begins_with[:substr] path = normalize_expression_path(path) filter_expression << "#{query_key}(#{path}, :#{substr})" end filter_expression end |
#query_key ⇒ Object
interface method so Contains < BeginsWith can override
28 29 30 |
# File 'lib/dynomite/item/query/params/function/begins_with.rb', line 28 def query_key :begins_with # must be a symbol end |