Class: Marathon::DeploymentAction

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

Overview

This class represents a Marathon Deployment action.

Instance Attribute Summary

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) ⇒ DeploymentAction

Create a new deployment action object. hash: Hash returned by API, including ‘app’ and ‘type’



6
7
8
# File 'lib/marathon/deployment_action.rb', line 6

def initialize(hash)
  super(hash, %w[app])
end

Instance Method Details

#to_pretty_sObject



16
17
18
# File 'lib/marathon/deployment_action.rb', line 16

def to_pretty_s
  "#{app}/#{type}"
end

#to_sObject



20
21
22
# File 'lib/marathon/deployment_action.rb', line 20

def to_s
  "Marathon::DeploymentAction { :app => #{app} :type => #{type} }"
end

#typeObject Also known as: action



10
11
12
# File 'lib/marathon/deployment_action.rb', line 10

def type
  info[:type] || info[:action]
end