module Adhoq::GlobalVariable
Public Class Methods
Source
# File lib/adhoq/global_variable.rb, line 5 def self.extended(base) base.extend MonitorMixin end
Public Instance Methods
Source
# File lib/adhoq/global_variable.rb, line 19 def config @config ||= Adhoq::Configuration.new end
Source
# File lib/adhoq/global_variable.rb, line 15 def configure(&block) yield config end
Source
# File lib/adhoq/global_variable.rb, line 9 def current_storage synchronize { @current_storage ||= setup_storage(*Adhoq.config.storage) } end
Private Instance Methods
Source
# File lib/adhoq/global_variable.rb, line 25 def setup_storage(type, *args) klass = case type when :local_file then Adhoq::Storage::LocalFile when :s3 then Adhoq::Storage::S3 when :on_the_fly then Adhoq::Storage::OnTheFly when :cache then Adhoq::Storage::Cache else raise NotImplementedError end klass.new(*args) end