Class: GhostAdapter::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/ghost_adapter/command.rb

Instance Method Summary collapse

Constructor Details

#initialize(alter:, table:, database: nil, dry_run: false) ⇒ Command

Returns a new instance of Command.



5
6
7
8
9
10
11
# File 'lib/ghost_adapter/command.rb', line 5

def initialize(alter:, table:, database: nil, dry_run: false)
  @alter = alter
  @table = table
  @database = GhostAdapter.config.database || database
  @dry_run = dry_run
  validate_args_and_config!
end

Instance Method Details

#to_aObject



13
14
15
16
17
18
19
20
# File 'lib/ghost_adapter/command.rb', line 13

def to_a
  [
    EXECUTABLE,
    *base_args,
    *config_args,
    *execute_arg
  ]
end