Class: Lynx::Command::Dump

Inherits:
Basic
  • Object
show all
Defined in:
lib/lynx/command/dump.rb

Instance Attribute Summary

Attributes inherited from Basic

#config

Instance Method Summary collapse

Methods inherited from Basic

#authorize, instruct

Constructor Details

#initialize(*args) ⇒ Dump

Returns a new instance of Dump.



6
7
8
9
10
11
12
13
# File 'lib/lynx/command/dump.rb', line 6

def initialize(*args)
  super(*args)

  @database = '--all-databases'
  @tables = []

  dump
end

Instance Method Details

#table(*args) ⇒ Object



23
24
25
26
27
# File 'lib/lynx/command/dump.rb', line 23

def table(*args)
  @tables += args

  self
end

#to_sObject



29
30
31
# File 'lib/lynx/command/dump.rb', line 29

def to_s
  "#{super} #{@database} #{@tables.join(' ')}"
end

#with_databaseObject



17
18
19
20
21
# File 'lib/lynx/command/dump.rb', line 17

def with_database
  @database = @config.database

  self
end