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 36 |
# File 'lib/prc_section_config.rb', line 32 def [](*keys) return nil if keys.length == 0 return _get(:default, *keys) if [:section].nil? _get([:section], *keys) end |
#[]=(*keys, value) ⇒ Object
38 39 40 41 42 |
# File 'lib/prc_section_config.rb', line 38 def []=(*keys, value) return nil if keys.length == 0 return _set(:default, *keys, value) if [:section].nil? _set([:section], *keys, value) end |
#del(*keys) ⇒ Object
56 57 58 59 60 |
# File 'lib/prc_section_config.rb', line 56 def del(*keys) return nil if keys.length == 0 return _del(:default, *keys) if [:section].nil? _del([:section], *keys) end |
#exist?(*keys) ⇒ Boolean
44 45 46 47 48 |
# File 'lib/prc_section_config.rb', line 44 def exist?(*keys) return nil if keys.length == 0 return _exist?(:default, *keys) if [:section].nil? _exist?([:section], *keys) end |
#where?(*keys) ⇒ Boolean
50 51 52 53 54 |
# File 'lib/prc_section_config.rb', line 50 def where?(*keys) return nil if keys.length == 0 return _exist?(:default, *keys) if [:section].nil? _where?([:section], *keys) end |