Class: PRC::SectionConfig
- Inherits:
-
BaseConfig
- Object
- BaseConfig
- PRC::SectionConfig
- Defined in:
- lib/prc_section_config.rb
Overview
SectionConfig class layer
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseConfig
Instance Method Summary collapse
-
#[](*keys) ⇒ Object
Get the value of a specific key under a section.
- #[]=(*keys, value) ⇒ Object
- #del(*keys) ⇒ Object
- #exist?(*keys) ⇒ Boolean
- #where?(*keys) ⇒ Boolean
Methods inherited from BaseConfig
#data_options, #erase, #initialize, #load, #rh_key_to_symbol, #rh_key_to_symbol?, #save, #to_s
Constructor Details
This class inherits a constructor from PRC::BaseConfig
Instance Method Details
#[](*keys) ⇒ Object
Get the value of a specific key under a section.
-
Args :
-
keys: keys to get values from a section set by data_options.If section is set, it will use :default
-
-
Returns :
-
key value.
-
-
Raises : Nothing
32 33 34 35 |
# File 'lib/prc_section_config.rb', line 32 def [](*keys) return _get(:default, *keys) if [:section].nil? _get([:section], *keys) end |
#[]=(*keys, value) ⇒ Object
37 38 39 40 |
# File 'lib/prc_section_config.rb', line 37 def []=(*keys, value) return _set(:default, *keys, value) if [:section].nil? _set([:section], *keys, value) end |
#del(*keys) ⇒ Object
52 53 54 55 |
# File 'lib/prc_section_config.rb', line 52 def del(*keys) return _del(:default, *keys) if [:section].nil? _del([:section], *keys) end |
#exist?(*keys) ⇒ Boolean
42 43 44 45 |
# File 'lib/prc_section_config.rb', line 42 def exist?(*keys) return _exist?(:default, *keys) if [:section].nil? _exist?([:section], *keys) end |
#where?(*keys) ⇒ Boolean
47 48 49 50 |
# File 'lib/prc_section_config.rb', line 47 def where?(*keys) return _exist?(:default, *keys) if [:section].nil? _where?([:section], *keys) end |