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.
6 7 8 |
# File 'lib/table_saw/configuration.rb', line 6 def dbname @dbname end |
#format ⇒ Object
Returns the value of attribute format.
6 7 8 |
# File 'lib/table_saw/configuration.rb', line 6 def format @format end |
#host ⇒ Object
Returns the value of attribute host.
6 7 8 |
# File 'lib/table_saw/configuration.rb', line 6 def host @host end |
#manifest ⇒ Object
Returns the value of attribute manifest.
6 7 8 |
# File 'lib/table_saw/configuration.rb', line 6 def manifest @manifest end |
#output ⇒ Object
Returns the value of attribute output.
6 7 8 |
# File 'lib/table_saw/configuration.rb', line 6 def output @output end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/table_saw/configuration.rb', line 6 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
6 7 8 |
# File 'lib/table_saw/configuration.rb', line 6 def port @port end |
#user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'lib/table_saw/configuration.rb', line 6 def user @user end |
#variables ⇒ Object
22 23 24 |
# File 'lib/table_saw/configuration.rb', line 22 def variables @variables || {} end |
Instance Method Details
#connection ⇒ Object
8 9 10 |
# File 'lib/table_saw/configuration.rb', line 8 def connection { adapter: 'postgresql', database: dbname, host:, port:, username: user, password: } end |
#url=(value) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/table_saw/configuration.rb', line 12 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 |