module TableCopy
Constants
- VERSION
Attributes
logger[W]
Public Class Methods
add_link(name, source, destination)
click to toggle source
# File lib/table_copy.rb, line 25 def add_link(name, source, destination) links_to_add[name] = TableCopy::Copier.new(source, destination) end
deferred_config(&block)
click to toggle source
# File lib/table_copy.rb, line 21 def deferred_config(&block) @deferred_config = block end
links()
click to toggle source
# File lib/table_copy.rb, line 12 def links if configured? @links else configure_links @links end end
logger()
click to toggle source
# File lib/table_copy.rb, line 8 def logger @logger ||= Logger.new($stdout) end
Private Class Methods
configure_links()
click to toggle source
# File lib/table_copy.rb, line 31 def configure_links synchronized do return @links if configured? @deferred_config.call if @deferred_config @links = links_to_add end end
configured?()
click to toggle source
# File lib/table_copy.rb, line 39 def configured? @links && !@links.empty? end
links_to_add()
click to toggle source
# File lib/table_copy.rb, line 43 def links_to_add @links_to_add ||= {} end
synchronized() { || ... }
click to toggle source
# File lib/table_copy.rb, line 47 def synchronized @semaphore ||= Mutex.new @semaphore.synchronize do yield end end