Class: MarathonDeploy::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/marathon_deploy/environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Environment

Returns a new instance of Environment.



8
9
10
11
12
13
# File 'lib/marathon_deploy/environment.rb', line 8

def initialize(name)
  if (!name.is_a? String)
    raise Error::BadFormatError, "argument for environment must be a string", caller      
  end
  @name = name.upcase
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/marathon_deploy/environment.rb', line 6

def name
  @name
end

Instance Method Details

#is_production?Boolean

Returns:

  • (Boolean)


19
20
21
22
23
24
# File 'lib/marathon_deploy/environment.rb', line 19

def is_production?
  if (@name.casecmp(MarathonDefaults::PRODUCTION_ENVIRONMENT_NAME) == 0)
    return true
  end
  return false
end

#marathon_endpointsObject



15
16
17
# File 'lib/marathon_deploy/environment.rb', line 15

def marathon_endpoints
  return 
end

#to_sObject



26
27
28
# File 'lib/marathon_deploy/environment.rb', line 26

def to_s
  @name
end