Class: Database
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from FogModel
#id, #initialize, #method_missing, #wait_until_ready
Constructor Details
This class inherits a constructor from FogModel
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class FogModel
Class Method Details
.create!(name, size, storage_size, password) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/dew/models/database.rb', line 3 def self.create!(name, size, storage_size, password) new Cloud.rds.servers.create( :engine => 'MySQL', :master_username => 'root', :password => password, :id => name, :allocated_storage => storage_size.to_s, :flavor_id => size ) end |
Instance Method Details
#db_environment_file(password) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/dew/models/database.rb', line 23 def db_environment_file password <<-EOF DB_HOST=#{fog_object.endpoint['Address']} DB_NAME=#{id} DB_USERNAME=#{master_username} DB_PASSWORD=#{password} EOF end |
#public_address ⇒ Object
19 20 21 |
# File 'lib/dew/models/database.rb', line 19 def public_address fog_object.endpoint['Address'] end |