Class: MinceDynamoDb::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/mince_dynamo_db/config.rb

Overview

DynamoDb Config

Config specifies the configuration settings

Author:

  • Matt Simpson

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.


42
43
44
# File 'lib/mince_dynamo_db/config.rb', line 42

def initialize
  @primary_key = :id
end

Instance Attribute Details

#primary_keyObject (readonly)

Returns the value of attribute primary_key


40
41
42
# File 'lib/mince_dynamo_db/config.rb', line 40

def primary_key
  @primary_key
end

Class Method Details

.access_key_idObject


28
29
30
# File 'lib/mince_dynamo_db/config.rb', line 28

def self.access_key_id
  instance.access_key_id
end

.access_key_id=(val) ⇒ Object


36
37
38
# File 'lib/mince_dynamo_db/config.rb', line 36

def self.access_key_id=(val)
  instance.access_key_id = val
end

.primary_keySymbol

Returns the primary key identifier for records. This is necessary because not all databases use the same primary key.

Returns:

  • (Symbol)

    the name of the primary key field.


17
18
19
# File 'lib/mince_dynamo_db/config.rb', line 17

def self.primary_key
  instance.primary_key
end

.secret_access_keyObject

Returns the secret access key used for authenticating with Amazon's DynamoDB service

Can either be set explicitely, or uses AWS.config by default


24
25
26
# File 'lib/mince_dynamo_db/config.rb', line 24

def self.secret_access_key
  instance.secret_access_key
end

.secret_access_key=(val) ⇒ Object


32
33
34
# File 'lib/mince_dynamo_db/config.rb', line 32

def self.secret_access_key=(val)
  instance.secret_access_key = val
end

Instance Method Details

#access_key_idObject


46
47
48
# File 'lib/mince_dynamo_db/config.rb', line 46

def access_key_id
  AWS.config.access_key_id
end

#access_key_id=(id) ⇒ Object


50
51
52
# File 'lib/mince_dynamo_db/config.rb', line 50

def access_key_id=(id)
  AWS.config.access_key_id = id
end

#secret_access_keyObject


54
55
56
# File 'lib/mince_dynamo_db/config.rb', line 54

def secret_access_key
  AWS.config.secret_access_key
end

#secret_access_key=(key) ⇒ Object


58
59
60
# File 'lib/mince_dynamo_db/config.rb', line 58

def secret_access_key=(key)
  AWS.config.secret_access_key = key
end