Class: Rays::Server::BaseServer

Inherits:
Object
  • Object
show all
Defined in:
lib/rays/servers/base.rb

Direct Known Subclasses

DatabaseServer, LiferayServer, SolrServer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, host, remote, java_home = nil, java_cmd = nil) ⇒ BaseServer

Returns a new instance of BaseServer.



29
30
31
32
33
34
35
36
# File 'lib/rays/servers/base.rb', line 29

def initialize(name, host, remote, java_home=nil, java_cmd=nil)
  @name = name
  @host = host
  @remote = remote
  @java_home = java_home
  @java_cmd = java_cmd
  default
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



27
28
29
# File 'lib/rays/servers/base.rb', line 27

def name
  @name
end

Instance Method Details

#hostObject

Raises:



38
39
40
41
# File 'lib/rays/servers/base.rb', line 38

def host
  raise RaysException.new(missing_environment_option(@name, 'host')) if @host.nil?
  @host
end

#java_cmdObject

Raises:



48
49
50
51
# File 'lib/rays/servers/base.rb', line 48

def java_cmd
  raise RaysException.new(missing_environment_option(@name, 'java command')) if @java_cmd.nil?
  @java_cmd
end

#java_homeObject

Raises:



43
44
45
46
# File 'lib/rays/servers/base.rb', line 43

def java_home
  raise RaysException.new(missing_environment_option(@name, 'java home')) if @java_home.nil?
  @java_home
end

#remoteObject

Raises:



57
58
59
60
# File 'lib/rays/servers/base.rb', line 57

def remote
  raise RaysException.new(missing_environment_option(@name, 'remote access')) if @remote.nil?
  @remote
end

#remote?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/rays/servers/base.rb', line 53

def remote?
  !@remote.nil?
end