Module: DatabaseUrl
- Defined in:
- lib/database_url.rb,
lib/database_url/version.rb
Constant Summary collapse
- DEFAULT_HOST =
'127.0.0.1'
- SEQUEL_FIELD_MAP =
{ 'pool' => 'max_connections', }
- ACTIVE_RECORD_FIELD_MAP =
{ 'pool' => 'pool', }
- VERSION =
'0.1.1'
Class Method Summary collapse
- .to_active_record_hash(url = nil) ⇒ Object
- .to_active_record_url(hash) ⇒ Object
- .to_sequel_hash(url = nil) ⇒ Object
- .to_sequel_url(hash) ⇒ Object
Class Method Details
.to_active_record_hash(url = nil) ⇒ Object
8 9 10 |
# File 'lib/database_url.rb', line 8 def to_active_record_hash(url = nil) to_hash ACTIVE_RECORD_FIELD_MAP, url end |
.to_active_record_url(hash) ⇒ Object
12 13 14 |
# File 'lib/database_url.rb', line 12 def to_active_record_url(hash) to_url ACTIVE_RECORD_FIELD_MAP, hash end |
.to_sequel_hash(url = nil) ⇒ Object
16 17 18 |
# File 'lib/database_url.rb', line 16 def to_sequel_hash(url = nil) to_hash SEQUEL_FIELD_MAP, url end |
.to_sequel_url(hash) ⇒ Object
20 21 22 |
# File 'lib/database_url.rb', line 20 def to_sequel_url(hash) to_url SEQUEL_FIELD_MAP, hash end |