Module: RedisCopy::UI
- Included in:
- AutoRun, CommandLine
- Defined in:
- lib/redis-copy/ui.rb,
lib/redis-copy/ui/auto_run.rb,
lib/redis-copy/ui/command_line.rb
Defined Under Namespace
Classes: AutoRun, CommandLine
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.load(options = {}) ⇒ Object
5
6
7
8
9
10
|
# File 'lib/redis-copy/ui.rb', line 5
def self.load(options = {})
ui = options.fetch(:ui, :auto_run)
const_name = ui.to_s.camelize
require "redis-copy/ui/#{ui}" unless const_defined?(const_name)
const_get(const_name).new(options)
end
|
Instance Method Details
#abort(message = nil) ⇒ Object
21
22
23
24
|
# File 'lib/redis-copy/ui.rb', line 21
def abort(message = nil)
return super if defined?(super)
raise NotImplementedError
end
|
#confirm?(prompt) ⇒ Boolean
16
17
18
19
|
# File 'lib/redis-copy/ui.rb', line 16
def confirm?(prompt)
return super if defined?(super)
raise NotImplementedError
end
|
#debug(message) ⇒ Object
31
32
33
|
# File 'lib/redis-copy/ui.rb', line 31
def debug(message)
notify(message) if @options[:debug]
end
|
#initialize(options) ⇒ Object
12
13
14
|
# File 'lib/redis-copy/ui.rb', line 12
def initialize(options)
@options = options
end
|
#notify(message) ⇒ Object
26
27
28
29
|
# File 'lib/redis-copy/ui.rb', line 26
def notify(message)
return super if defined?(super)
raise NotImplementedError
end
|