Class: Dynamoid::Criteria::KeyFieldsDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamoid/criteria/key_fields_detector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query, source) ⇒ KeyFieldsDetector

Returns a new instance of KeyFieldsDetector.



8
9
10
11
12
13
# File 'lib/dynamoid/criteria/key_fields_detector.rb', line 8

def initialize(query, source)
  @query = query
  @source = source

  detect_keys
end

Instance Attribute Details

#hash_keyObject (readonly)

Returns the value of attribute hash_key.



6
7
8
# File 'lib/dynamoid/criteria/key_fields_detector.rb', line 6

def hash_key
  @hash_key
end

#index_nameObject (readonly)

Returns the value of attribute index_name.



6
7
8
# File 'lib/dynamoid/criteria/key_fields_detector.rb', line 6

def index_name
  @index_name
end

#range_keyObject (readonly)

Returns the value of attribute range_key.



6
7
8
# File 'lib/dynamoid/criteria/key_fields_detector.rb', line 6

def range_key
  @range_key
end

Instance Method Details

#key_present?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/dynamoid/criteria/key_fields_detector.rb', line 15

def key_present?
  @hash_key.present?
end