Class: Taketo::Constructs::Server

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

Instance Attribute Summary collapse

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

Returns a new instance of Server.



12
13
14
15
16
# File 'lib/taketo/constructs/server.rb', line 12

def initialize(name)
  super
  @environment_variables = {}
  @ssh_command = :ssh
end

Instance Attribute Details

#default_commandObject

Returns the value of attribute default_command.



8
9
10
# File 'lib/taketo/constructs/server.rb', line 8

def default_command
  @default_command
end

#default_locationObject

Returns the value of attribute default_location.



8
9
10
# File 'lib/taketo/constructs/server.rb', line 8

def default_location
  @default_location
end

#environment_variablesObject (readonly)

Returns the value of attribute environment_variables.



7
8
9
# File 'lib/taketo/constructs/server.rb', line 7

def environment_variables
  @environment_variables
end

#global_aliasObject

Returns the value of attribute global_alias.



8
9
10
# File 'lib/taketo/constructs/server.rb', line 8

def global_alias
  @global_alias
end

#hostObject

Returns the value of attribute host.



8
9
10
# File 'lib/taketo/constructs/server.rb', line 8

def host
  @host
end

#identity_fileObject

Returns the value of attribute identity_file.



8
9
10
# File 'lib/taketo/constructs/server.rb', line 8

def identity_file
  @identity_file
end

#portObject

Returns the value of attribute port.



8
9
10
# File 'lib/taketo/constructs/server.rb', line 8

def port
  @port
end

#ssh_commandObject

Returns the value of attribute ssh_command.



8
9
10
# File 'lib/taketo/constructs/server.rb', line 8

def ssh_command
  @ssh_command
end

#usernameObject

Returns the value of attribute username.



8
9
10
# File 'lib/taketo/constructs/server.rb', line 8

def username
  @username
end

Instance Method Details

#env(env_variables) ⇒ Object



18
19
20
# File 'lib/taketo/constructs/server.rb', line 18

def env(env_variables)
  @environment_variables.merge!(env_variables)
end

#parent=(parent) ⇒ Object



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

def parent=(parent)
  super
  env(:RAILS_ENV => parent.rails_env) if parent.respond_to?(:rails_env)
end