Class: GOCD::PIPELINE_CONFIG::Pipeline

Inherits:
Object
  • Object
show all
Includes:
GOCD::PIPELINE_CONFIG
Defined in:
lib/gocd/pipeline_config/pipeline.rb

Direct Known Subclasses

Template

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GOCD::PIPELINE_CONFIG

#environments, #groups, #pipeline_config_response, #pipelines, #templates, #to_array

Constructor Details

#initialize(data) ⇒ Pipeline

Returns a new instance of Pipeline.



9
10
11
12
13
14
# File 'lib/gocd/pipeline_config/pipeline.rb', line 9

def initialize(data)
  @template = data['@template']
  @name = data['@name']
  @stages = to_stages(data['stage']) || []
  @params = parse_params(data)
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



7
8
9
# File 'lib/gocd/pipeline_config/pipeline.rb', line 7

def environment
  @environment
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/gocd/pipeline_config/pipeline.rb', line 7

def name
  @name
end

#paramsObject (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/gocd/pipeline_config/pipeline.rb', line 7

def params
  @params
end

#stagesObject (readonly)

Returns the value of attribute stages.



7
8
9
# File 'lib/gocd/pipeline_config/pipeline.rb', line 7

def stages
  @stages
end

#templateObject (readonly)

Returns the value of attribute template.



7
8
9
# File 'lib/gocd/pipeline_config/pipeline.rb', line 7

def template
  @template
end

Instance Method Details

#has_template?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/gocd/pipeline_config/pipeline.rb', line 16

def has_template?
  !template.nil?
end