Class: DbSchema::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/db_schema/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter: 'postgres', host: 'localhost', port: 5432, database:, user: nil, password: '', log_changes: true, dry_run: false, post_check: true) ⇒ Configuration

Returns a new instance of Configuration.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/db_schema/configuration.rb', line 5

def initialize(adapter: 'postgres', host: 'localhost', port: 5432, database:, user: nil, password: '', log_changes: true, dry_run: false, post_check: true)
  @adapter     = adapter
  @host        = host
  @port        = port
  @database    = database
  @user        = user
  @password    = password
  @log_changes = log_changes
  @dry_run     = dry_run
  @post_check  = post_check
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



3
4
5
# File 'lib/db_schema/configuration.rb', line 3

def adapter
  @adapter
end

#databaseObject (readonly)

Returns the value of attribute database.



3
4
5
# File 'lib/db_schema/configuration.rb', line 3

def database
  @database
end

#hostObject (readonly)

Returns the value of attribute host.



3
4
5
# File 'lib/db_schema/configuration.rb', line 3

def host
  @host
end

#passwordObject (readonly)

Returns the value of attribute password.



3
4
5
# File 'lib/db_schema/configuration.rb', line 3

def password
  @password
end

#portObject (readonly)

Returns the value of attribute port.



3
4
5
# File 'lib/db_schema/configuration.rb', line 3

def port
  @port
end

#userObject (readonly)

Returns the value of attribute user.



3
4
5
# File 'lib/db_schema/configuration.rb', line 3

def user
  @user
end

Instance Method Details

#dry_run?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/db_schema/configuration.rb', line 21

def dry_run?
  @dry_run
end

#log_changes?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/db_schema/configuration.rb', line 17

def log_changes?
  @log_changes
end

#post_check_enabled?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/db_schema/configuration.rb', line 25

def post_check_enabled?
  @post_check
end