Class: FakeDynamo::KeySchema

Inherits:
Object
  • Object
show all
Defined in:
lib/fake_dynamo/key_schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ KeySchema

Returns a new instance of KeySchema.



6
7
8
# File 'lib/fake_dynamo/key_schema.rb', line 6

def initialize(data)
  extract_values(data)
end

Instance Attribute Details

#hash_keyObject

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_keyObject

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

#descriptionObject



10
11
12
13
14
15
16
# File 'lib/fake_dynamo/key_schema.rb', line 10

def description
  description = { 'HashKeyElement' => hash_key.description }
  if range_key
    description['RangeKeyElement'] = range_key.description
  end
  description
end