Class: Pgai::Resources::Local::Clone
Instance Method Summary
collapse
Methods inherited from BaseRecord
all, backend, delete, #delete, find, #klass, record_type, #save
Methods included from Attributes
#assign_attribute, #assign_attributes, #has_attribute?, included, #initialize
Instance Method Details
#connection_string ⇒ Object
17
18
19
|
# File 'lib/pgai/resources/local/clone.rb', line 17
def connection_string
"'host=#{host} port=#{local_port} user=#{user} dbname=#{dbname} password=#{password}'"
end
|
#database_url ⇒ Object
21
22
23
|
# File 'lib/pgai/resources/local/clone.rb', line 21
def database_url
"postgresql://#{user}:#{password}@#{host}:#{local_port}/#{dbname}"
end
|
#with_port_forward(manager = Pgai::Commander.instance.port_manager) ⇒ Object
25
26
27
28
29
|
# File 'lib/pgai/resources/local/clone.rb', line 25
def with_port_forward(manager = Pgai::Commander.instance.port_manager)
manager.forward(local_port, remote_host, port) do
yield self
end
end
|