Class: Dynamoid::Criteria::KeyFieldsDetector
- Inherits:
-
Object
- Object
- Dynamoid::Criteria::KeyFieldsDetector
- Defined in:
- lib/dynamoid/criteria/key_fields_detector.rb
Defined Under Namespace
Classes: Query
Instance Method Summary collapse
- #hash_key ⇒ Object
- #index_name ⇒ Object
-
#initialize(query, source) ⇒ KeyFieldsDetector
constructor
A new instance of KeyFieldsDetector.
- #key_present? ⇒ Boolean
- #range_key ⇒ Object
Constructor Details
#initialize(query, source) ⇒ KeyFieldsDetector
Returns a new instance of KeyFieldsDetector.
23 24 25 26 27 28 |
# File 'lib/dynamoid/criteria/key_fields_detector.rb', line 23 def initialize(query, source) @query = query @source = source @query = Query.new(query) @result = find_keys_in_query end |
Instance Method Details
#hash_key ⇒ Object
34 35 36 |
# File 'lib/dynamoid/criteria/key_fields_detector.rb', line 34 def hash_key @result && @result[:hash_key] end |
#index_name ⇒ Object
42 43 44 |
# File 'lib/dynamoid/criteria/key_fields_detector.rb', line 42 def index_name @result && @result[:index_name] end |
#key_present? ⇒ Boolean
30 31 32 |
# File 'lib/dynamoid/criteria/key_fields_detector.rb', line 30 def key_present? @result.present? end |
#range_key ⇒ Object
38 39 40 |
# File 'lib/dynamoid/criteria/key_fields_detector.rb', line 38 def range_key @result && @result[:range_key] end |