Class: FakeDynamo::KeySchema
- Inherits:
-
Object
- Object
- FakeDynamo::KeySchema
- Defined in:
- lib/fake_dynamo/key_schema.rb
Instance Attribute Summary collapse
-
#hash_key ⇒ Object
Returns the value of attribute hash_key.
-
#range_key ⇒ Object
Returns the value of attribute range_key.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(key_schema, attribute_definitions) ⇒ KeySchema
constructor
A new instance of KeySchema.
- #keys ⇒ Object
Constructor Details
#initialize(key_schema, attribute_definitions) ⇒ KeySchema
Returns a new instance of KeySchema.
6 7 8 |
# File 'lib/fake_dynamo/key_schema.rb', line 6 def initialize(key_schema, attribute_definitions) extract_values(key_schema, attribute_definitions) end |
Instance Attribute Details
#hash_key ⇒ Object
Returns the value of attribute hash_key.
4 5 6 |
# File 'lib/fake_dynamo/key_schema.rb', line 4 def hash_key @hash_key end |
#range_key ⇒ Object
Returns the value of attribute range_key.
4 5 6 |
# File 'lib/fake_dynamo/key_schema.rb', line 4 def range_key @range_key end |
Instance Method Details
#description ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/fake_dynamo/key_schema.rb', line 10 def description description = [{'AttributeName' => hash_key.name, 'KeyType' => 'HASH'}] if range_key description << {'AttributeName' => range_key.name, 'KeyType' => 'RANGE'} end description end |
#keys ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/fake_dynamo/key_schema.rb', line 18 def keys result = [hash_key.name] if range_key result << range_key.name end result end |