Module: RemoteDatabaseCleaner

Defined in:
lib/remote_database_cleaner.rb,
lib/remote_database_cleaner/http.rb,
lib/remote_database_cleaner/config.rb,
lib/remote_database_cleaner/version.rb,
lib/remote_database_cleaner/exceptions.rb,
lib/remote_database_cleaner/config_struct.rb

Defined Under Namespace

Classes: Config, ConfigStruct, Http, RemoteDatabaseCleaner, RemoteDatabaseCleanerConfigError

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.clean(http = Http) ⇒ Object



18
19
20
21
# File 'lib/remote_database_cleaner.rb', line 18

def self.clean(http = Http)
  database_cleaner = RemoteDatabaseCleaner.new
  http.post(config, database_cleaner.params)
end

.configObject



23
24
25
# File 'lib/remote_database_cleaner.rb', line 23

def self.config
  @config
end

.config=(config) ⇒ Object



27
28
29
# File 'lib/remote_database_cleaner.rb', line 27

def self.config=(config)
  @config = config
end

.configure(opts = { :config_struct => ConfigStruct, :config => Config }, &block) ⇒ Object



13
14
15
16
# File 'lib/remote_database_cleaner.rb', line 13

def self.configure(opts = { :config_struct => ConfigStruct, :config => Config }, &block)
  config      = opts.fetch(:config_struct).block_to_hash(block)
  self.config = opts.fetch(:config).configure(config)
end

.reset(config = Config.new) ⇒ Object



31
32
33
# File 'lib/remote_database_cleaner.rb', line 31

def self.reset(config = Config.new)
  self.config = config
end