Class: Gem::Release::Config
- Inherits:
-
Object
- Object
- Gem::Release::Config
- Includes:
- Helper::Hash
- Defined in:
- lib/gem/release/config.rb,
lib/gem/release/config/env.rb,
lib/gem/release/config/files.rb
Defined Under Namespace
Constant Summary collapse
Constants included from Helper::Hash
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #common ⇒ Object
- #for(key) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Methods included from Helper::Hash
#deep_merge, #except, #only, #symbolize_keys
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
14 15 16 |
# File 'lib/gem/release/config.rb', line 14 def initialize @opts = load end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
10 11 12 |
# File 'lib/gem/release/config.rb', line 10 def opts @opts end |
Instance Method Details
#[](key) ⇒ Object
18 19 20 |
# File 'lib/gem/release/config.rb', line 18 def [](key) opts[key] end |
#common ⇒ Object
26 27 28 |
# File 'lib/gem/release/config.rb', line 26 def common opts.reject { |_, value| value.is_a?(Hash) } end |
#for(key) ⇒ Object
22 23 24 |
# File 'lib/gem/release/config.rb', line 22 def for(key) common.merge(self[key] || {}) end |