Module: Dabcup::Operation

Defined in:
lib/dabcup/operation.rb,
lib/dabcup/operation/get.rb,
lib/dabcup/operation/base.rb,
lib/dabcup/operation/dump.rb,
lib/dabcup/operation/list.rb,
lib/dabcup/operation/clean.rb,
lib/dabcup/operation/clear.rb,
lib/dabcup/operation/remove.rb,
lib/dabcup/operation/restore.rb,
lib/dabcup/operation/populate.rb

Defined Under Namespace

Classes: Base, Clean, Clear, Dump, Get, List, Populate, Remove, Restore

Class Method Summary collapse

Class Method Details

.build(name, config) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dabcup/operation.rb', line 13

def self.build(name, config)
  case name
  when 'dump' then Dabcup::Operation::Dump.new(config)
  when 'restore' then Dabcup::Operation::Restore.new(config)
  when 'list' then Dabcup::Operation::List.new(config)
  when 'get' then Dabcup::Operation::Get.new(config)
  when 'remove' then Dabcup::Operation::Remove.new(config)
  when 'clear' then Dabcup::Operation::Clear.new(config)
  when 'clean' then Dabcup::Operation::Clean.new(config)
  when 'populate' then Dabcup::Operation::Populate.new(config)
  when 'test' then Dabcup::Operation::Test.new(config)
  else
    raise Dabcup::Error.new("Unknow operation '#{name}'.")
  end
end