Class: GOCD::PIPELINE_CONFIG::Environment
- Inherits:
-
Object
- Object
- GOCD::PIPELINE_CONFIG::Environment
- Includes:
- GOCD::PIPELINE_CONFIG
- Defined in:
- lib/gocd/pipeline_config/environment.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pipeline_names ⇒ Object
readonly
Returns the value of attribute pipeline_names.
-
#pipelines ⇒ Object
readonly
Returns the value of attribute pipelines.
Instance Method Summary collapse
- #enrich_with_pipelines(pipelines) ⇒ Object
- #has_pipeline?(pipeline) ⇒ Boolean
-
#initialize(environment) ⇒ Environment
constructor
A new instance of Environment.
Methods included from GOCD::PIPELINE_CONFIG
#environments, #groups, #pipeline_config_response, #templates, #to_array
Constructor Details
#initialize(environment) ⇒ Environment
Returns a new instance of Environment.
9 10 11 12 |
# File 'lib/gocd/pipeline_config/environment.rb', line 9 def initialize(environment) @name = environment['@name'] @pipeline_names = to_pipelines(environment["pipelines"] || {}) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/gocd/pipeline_config/environment.rb', line 7 def name @name end |
#pipeline_names ⇒ Object (readonly)
Returns the value of attribute pipeline_names.
7 8 9 |
# File 'lib/gocd/pipeline_config/environment.rb', line 7 def pipeline_names @pipeline_names end |
#pipelines ⇒ Object (readonly)
Returns the value of attribute pipelines.
7 8 9 |
# File 'lib/gocd/pipeline_config/environment.rb', line 7 def pipelines @pipelines end |
Instance Method Details
#enrich_with_pipelines(pipelines) ⇒ Object
18 19 20 21 |
# File 'lib/gocd/pipeline_config/environment.rb', line 18 def enrich_with_pipelines(pipelines) pipelines.each { |pipeline| pipeline.environment = name } @pipelines = pipelines end |
#has_pipeline?(pipeline) ⇒ Boolean
14 15 16 |
# File 'lib/gocd/pipeline_config/environment.rb', line 14 def has_pipeline?(pipeline) pipelines.include? pipeline end |