Class: Marathon::DeploymentStep

Inherits:
Base
  • Object
show all
Defined in:
lib/marathon/deployment_step.rb

Overview

This class represents a Marathon Deployment step.

Instance Attribute Summary collapse

Attributes inherited from Base

#info

Instance Method Summary collapse

Methods inherited from Base

#to_json

Methods included from Error

error_class, error_message, from_response

Constructor Details

#initialize(hash) ⇒ DeploymentStep

Create a new deployment step object. hash: Hash returned by API, including ‘actions’



8
9
10
11
12
13
14
15
# File 'lib/marathon/deployment_step.rb', line 8

def initialize(hash)
  super(hash)
  if hash.is_a?(Array)
    @actions = info.map { |e| Marathon::DeploymentAction.new(e) }
  else
    @actions = (info[:actions] || []).map { |e| Marathon::DeploymentAction.new(e) }
  end
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



4
5
6
# File 'lib/marathon/deployment_step.rb', line 4

def actions
  @actions
end

Instance Method Details

#to_sObject



17
18
19
# File 'lib/marathon/deployment_step.rb', line 17

def to_s
  "Marathon::DeploymentStep { :actions => #{actions.map { |e| e.to_pretty_s }.join(',')} }"
end