class Dynamoid::Criteria::KeyFieldsDetector::Query
Public Class Methods
new(query_hash)
click to toggle source
# File lib/dynamoid/criteria/key_fields_detector.rb, line 8 def initialize(query_hash) @query_hash = query_hash @fields_with_operator = query_hash.keys.map(&:to_s) @fields = query_hash.keys.map(&:to_s).map { |s| s.split('.').first } end
Public Instance Methods
contain?(field_name)
click to toggle source
# File lib/dynamoid/criteria/key_fields_detector.rb, line 18 def contain?(field_name) @fields.include?(field_name.to_s) end
contain_only?(field_names)
click to toggle source
# File lib/dynamoid/criteria/key_fields_detector.rb, line 14 def contain_only?(field_names) (@fields - field_names.map(&:to_s)).blank? end
contain_with_eq_operator?(field_name)
click to toggle source
# File lib/dynamoid/criteria/key_fields_detector.rb, line 22 def contain_with_eq_operator?(field_name) @fields_with_operator.include?(field_name.to_s) end