Class: Rays::Server::DatabaseServer
- Inherits:
-
BaseServer
- Object
- BaseServer
- Rays::Server::DatabaseServer
- Defined in:
- lib/rays/servers/database.rb
Instance Attribute Summary
Attributes inherited from BaseServer
Instance Method Summary collapse
- #db_name ⇒ Object
-
#initialize(name, host, remote, java_home, java_bin, port, db_name, username, password, type) ⇒ DatabaseServer
constructor
A new instance of DatabaseServer.
- #instance ⇒ Object
- #password ⇒ Object
- #port ⇒ Object
- #type ⇒ Object
- #username ⇒ Object
Methods inherited from BaseServer
#host, #java_cmd, #java_home, #remote, #remote?
Constructor Details
#initialize(name, host, remote, java_home, java_bin, port, db_name, username, password, type) ⇒ DatabaseServer
Returns a new instance of DatabaseServer.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rays/servers/database.rb', line 28 def initialize(name, host, remote, java_home, java_bin, port, db_name, username, password, type) super(name, host, remote, java_home, java_bin) @port = port @db_name = db_name @username = username @password = password @type = type @instance = nil if 'mysql'.eql?(@type) @instance = Rays::Database::MySQL.new @host, @port, @username, @password end end |
Instance Method Details
#db_name ⇒ Object
47 48 49 50 |
# File 'lib/rays/servers/database.rb', line 47 def db_name raise RaysException.new(missing_environment_option('Database server', 'database name')) if @db_name.nil? @db_name end |
#instance ⇒ Object
67 68 69 70 |
# File 'lib/rays/servers/database.rb', line 67 def instance raise RaysException.new("Unknown database type #{@type}") if @instance.nil? @instance end |
#password ⇒ Object
57 58 59 60 |
# File 'lib/rays/servers/database.rb', line 57 def password raise RaysException.new(missing_environment_option('Database server', 'password')) if @password.nil? @password end |
#port ⇒ Object
42 43 44 45 |
# File 'lib/rays/servers/database.rb', line 42 def port raise RaysException.new(missing_environment_option('Database server', 'port')) if @port.nil? @port end |
#type ⇒ Object
62 63 64 65 |
# File 'lib/rays/servers/database.rb', line 62 def type raise RaysException.new(missing_environment_option('Database server', 'type')) if @type.nil? @type end |
#username ⇒ Object
52 53 54 55 |
# File 'lib/rays/servers/database.rb', line 52 def username raise RaysException.new(missing_environment_option('Database server', 'username')) if @username.nil? @username end |