Class: TableSaw::Configuration
- Inherits:
-
Object
- Object
- TableSaw::Configuration
- Defined in:
- lib/table_saw/configuration.rb
Instance Attribute Summary collapse
-
#dbname ⇒ Object
Returns the value of attribute dbname.
-
#format ⇒ Object
Returns the value of attribute format.
-
#host ⇒ Object
Returns the value of attribute host.
-
#manifest ⇒ Object
Returns the value of attribute manifest.
-
#output ⇒ Object
Returns the value of attribute output.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#user ⇒ Object
Returns the value of attribute user.
- #variables ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#dbname ⇒ Object
Returns the value of attribute dbname.
7 8 9 |
# File 'lib/table_saw/configuration.rb', line 7 def dbname @dbname end |
#format ⇒ Object
Returns the value of attribute format.
7 8 9 |
# File 'lib/table_saw/configuration.rb', line 7 def format @format end |
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/table_saw/configuration.rb', line 7 def host @host end |
#manifest ⇒ Object
Returns the value of attribute manifest.
7 8 9 |
# File 'lib/table_saw/configuration.rb', line 7 def manifest @manifest end |
#output ⇒ Object
Returns the value of attribute output.
7 8 9 |
# File 'lib/table_saw/configuration.rb', line 7 def output @output end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/table_saw/configuration.rb', line 7 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/table_saw/configuration.rb', line 7 def port @port end |
#user ⇒ Object
Returns the value of attribute user.
7 8 9 |
# File 'lib/table_saw/configuration.rb', line 7 def user @user end |
#variables ⇒ Object
23 24 25 |
# File 'lib/table_saw/configuration.rb', line 23 def variables @variables || {} end |
Instance Method Details
#connection ⇒ Object
9 10 11 |
# File 'lib/table_saw/configuration.rb', line 9 def connection { adapter: 'postgresql', database: dbname, host:, port:, username: user, password: } end |
#url=(value) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/table_saw/configuration.rb', line 13 def url=(value) URI.parse(value).tap do |uri| self.dbname = uri.path[1..] self.host = uri.host self.port = uri.port self.user = uri.user self.password = uri.password end end |