Class: Gitlab::Ci::Config::Extendable
- Inherits:
-
Object
- Object
- Gitlab::Ci::Config::Extendable
- Includes:
- Enumerable
- Defined in:
- lib/gitlab/ci/config/extendable.rb,
lib/gitlab/ci/config/extendable/entry.rb
Defined Under Namespace
Classes: Entry
Constant Summary collapse
- ExtensionError =
Class.new(StandardError)
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(hash) ⇒ Extendable
constructor
A new instance of Extendable.
- #to_hash ⇒ Object
Constructor Details
#initialize(hash) ⇒ Extendable
Returns a new instance of Extendable.
11 12 13 14 15 |
# File 'lib/gitlab/ci/config/extendable.rb', line 11 def initialize(hash) @hash = hash.to_h.deep_dup each { |entry| entry.extend! if entry.extensible? } end |
Instance Method Details
#each ⇒ Object
17 18 19 20 21 |
# File 'lib/gitlab/ci/config/extendable.rb', line 17 def each @hash.each_key do |key| yield Extendable::Entry.new(key, @hash) end end |
#to_hash ⇒ Object
23 24 25 |
# File 'lib/gitlab/ci/config/extendable.rb', line 23 def to_hash @hash.to_h end |