Class: Gitlab::Ci::Config::Yaml::Tags::Base
- Inherits:
-
Object
- Object
- Gitlab::Ci::Config::Yaml::Tags::Base
- Extended by:
- Utils::Override
- Defined in:
- lib/gitlab/ci/config/yaml/tags/base.rb
Direct Known Subclasses
Constant Summary collapse
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#resolved_status ⇒ Object
Returns the value of attribute resolved_status.
-
#resolved_value ⇒ Object
Returns the value of attribute resolved_value.
Class Method Summary collapse
Instance Method Summary collapse
-
#init_with(coder) ⇒ Object
Only one of the ‘seq`, `scalar`, `map` fields is available.
- #resolve(resolver) ⇒ Object
- #valid? ⇒ Boolean
Methods included from Utils::Override
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
14 15 16 |
# File 'lib/gitlab/ci/config/yaml/tags/base.rb', line 14 def data @data end |
#resolved_status ⇒ Object
Returns the value of attribute resolved_status.
14 15 16 |
# File 'lib/gitlab/ci/config/yaml/tags/base.rb', line 14 def resolved_status @resolved_status end |
#resolved_value ⇒ Object
Returns the value of attribute resolved_value.
14 15 16 |
# File 'lib/gitlab/ci/config/yaml/tags/base.rb', line 14 def resolved_value @resolved_value end |
Class Method Details
.tag ⇒ Object
16 17 18 |
# File 'lib/gitlab/ci/config/yaml/tags/base.rb', line 16 def self.tag raise NotImplementedError end |
Instance Method Details
#init_with(coder) ⇒ Object
Only one of the ‘seq`, `scalar`, `map` fields is available.
21 22 23 24 25 26 27 28 29 |
# File 'lib/gitlab/ci/config/yaml/tags/base.rb', line 21 def init_with(coder) @data = { tag: coder.tag, # This is the custom YAML tag, like !reference or !flatten style: coder.style, seq: coder.seq, # This holds Array data scalar: coder.scalar, # This holds data of basic types, like String. map: coder.map # This holds Hash data. } end |
#resolve(resolver) ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/gitlab/ci/config/yaml/tags/base.rb', line 35 def resolve(resolver) raise NotValidError, unless valid? raise CircularReferenceError, if resolving? return resolved_value if resolved? self.resolved_status = :in_progress self.resolved_value = _resolve(resolver) self.resolved_status = :done resolved_value end |
#valid? ⇒ Boolean
31 32 33 |
# File 'lib/gitlab/ci/config/yaml/tags/base.rb', line 31 def valid? raise NotImplementedError end |