Module: TinyDyno::HashKey

Extended by:
ActiveSupport::Concern
Included in:
DocumentComposition
Defined in:
lib/tiny_dyno/hash_key.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#hash_key_as_selectorObject

return all defined hash keys on an instantiated object for further use in DynamoDB queries, i.e. to look up an object



17
18
19
# File 'lib/tiny_dyno/hash_key.rb', line 17

def hash_key_as_selector
  { "#{ self.class.primary_key[:attr] }": attributes[self.class.primary_key[:attr]] }
end