Class: CloudConfig::Providers::InMemory
- Inherits:
-
Object
- Object
- CloudConfig::Providers::InMemory
- Defined in:
- lib/cloud-config/providers/in_memory.rb
Overview
A class that acts as a provider for storing configuration in-memory
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
-
#get(key, _opts = {}) ⇒ Object
Fetch the value of the key.
-
#initialize(_opts = {}) ⇒ InMemory
constructor
Create an instance of InMemory.
-
#set(key, value) ⇒ Object
Set the value of the key.
Constructor Details
#initialize(_opts = {}) ⇒ InMemory
Create an instance of CloudConfig::Providers::InMemory
17 18 19 |
# File 'lib/cloud-config/providers/in_memory.rb', line 17 def initialize(_opts = {}) @settings = {} end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
14 15 16 |
# File 'lib/cloud-config/providers/in_memory.rb', line 14 def settings @settings end |
Instance Method Details
#get(key, _opts = {}) ⇒ Object
Fetch the value of the key
26 27 28 |
# File 'lib/cloud-config/providers/in_memory.rb', line 26 def get(key, _opts = {}) settings[key] end |
#set(key, value) ⇒ Object
Set the value of the key
34 35 36 |
# File 'lib/cloud-config/providers/in_memory.rb', line 34 def set(key, value) @settings[key] = value end |