Class: Migreazy::Action

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

Direct Known Subclasses

Diff, Down, Find

Defined Under Namespace

Classes: Diff, Down, Find

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Action

Returns a new instance of Action.



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/migreazy.rb', line 24

def initialize(args)
  @args = args
  if args.empty?
    @source1 = Source::Database.new
    @source2 = Source::WorkingCopy.new
  elsif args.size == 1
    @source1 = Source::Database.new
    @source2 = Source.new_from_command_line_arg(args.first)
  elsif args.size == 2
    @source1 = Source.new_from_command_line_arg(args.first)
    @source2 = Source.new_from_command_line_arg(args.last)
  end
end