Class: MarathonDeploy::Environment
- Inherits:
-
Object
- Object
- MarathonDeploy::Environment
- Defined in:
- lib/marathon_deploy/environment.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Environment
constructor
A new instance of Environment.
- #is_production? ⇒ Boolean
- #marathon_endpoints ⇒ Object
- #to_s ⇒ Object
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
#name ⇒ Object (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
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_endpoints ⇒ Object
15 16 17 |
# File 'lib/marathon_deploy/environment.rb', line 15 def marathon_endpoints return end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/marathon_deploy/environment.rb', line 26 def to_s @name end |