Class: Moltrio::Config::DatabaseYmlAdapter
- Defined in:
- lib/moltrio/config/adapters/database_yml_adapter.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#real_storage ⇒ Object
readonly
Returns the value of attribute real_storage.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #has_key?(key) ⇒ Boolean
-
#initialize(path, environment: rails_environment) ⇒ DatabaseYmlAdapter
constructor
A new instance of DatabaseYmlAdapter.
- #missing_namespace? ⇒ Boolean
Methods inherited from Adapter
#available_namespaces, #fetch, #fetch_all, #on_namespace, #slice
Constructor Details
#initialize(path, environment: rails_environment) ⇒ DatabaseYmlAdapter
Returns a new instance of DatabaseYmlAdapter.
9 10 11 12 |
# File 'lib/moltrio/config/adapters/database_yml_adapter.rb', line 9 def initialize(path, environment: rails_environment) @real_storage = FileStorage.new(path) @environment = environment end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
8 9 10 |
# File 'lib/moltrio/config/adapters/database_yml_adapter.rb', line 8 def environment @environment end |
#real_storage ⇒ Object (readonly)
Returns the value of attribute real_storage.
8 9 10 |
# File 'lib/moltrio/config/adapters/database_yml_adapter.rb', line 8 def real_storage @real_storage end |
Instance Method Details
#[](key) ⇒ Object
18 19 20 |
# File 'lib/moltrio/config/adapters/database_yml_adapter.rb', line 18 def [](key) real_storage[transform_key(key)] end |
#[]=(key, value) ⇒ Object
22 23 24 |
# File 'lib/moltrio/config/adapters/database_yml_adapter.rb', line 22 def []=(key, value) real_storage[transform_key(key)] = value end |
#has_key?(key) ⇒ Boolean
26 27 28 |
# File 'lib/moltrio/config/adapters/database_yml_adapter.rb', line 26 def has_key?(key) real_storage.has_key?(transform_key(key)) end |
#missing_namespace? ⇒ Boolean
14 15 16 |
# File 'lib/moltrio/config/adapters/database_yml_adapter.rb', line 14 def missing_namespace? false end |