Class: Taketo::Constructs::Environment

Inherits:
BaseConstruct show all
Defined in:
lib/taketo/constructs/environment.rb

Instance Attribute Summary

Attributes inherited from BaseConstruct

#default_server_config, #name, #parent

Instance Method Summary collapse

Methods inherited from BaseConstruct

#node_type, #parents, #path, #qualified_name

Methods included from AssociatedNodes

included

Constructor Details

#initialize(name) ⇒ Environment

Returns a new instance of Environment.



10
11
12
# File 'lib/taketo/constructs/environment.rb', line 10

def initialize(name)
  super(name)
end

Instance Method Details

#has_servers?Boolean

Returns:

  • (Boolean)


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

def has_servers?
  has_deeply_nested_nodes?(:servers)
end

#project_nameObject



14
15
16
17
18
19
20
# File 'lib/taketo/constructs/environment.rb', line 14

def project_name
  if parent.is_a?(Project)
    parent.name
  else
    ""
  end
end

#rails_envObject



22
23
24
# File 'lib/taketo/constructs/environment.rb', line 22

def rails_env
  name.to_s
end