class RightPublish::StorageManager

Public Class Methods

get_storage(type) click to toggle source
# File lib/right_publish/storage.rb, line 9
def self.get_storage(type)
  @@storage_table[type] if @@storage_table[type]
end
register_storage(module_type) click to toggle source
# File lib/right_publish/storage.rb, line 19
def self.register_storage(module_type)
  storage_key = module_type::STORAGE_KEY

  if module_type.respond_to?(:get_directories) && @@storage_type_regex.match(storage_key.to_s)
   @@storage_table[storage_key] = module_type
   RightPublish::Profile.instance.register_section(@@storage_type_regex.match(storage_key.to_s)[1], module_type::STORAGE_OPTIONS)
  else
    raise TypeError
  end
  nil
end
storage_types() click to toggle source
# File lib/right_publish/storage.rb, line 13
def self.storage_types()
  type_hash = {}
  @@storage_table.each_key { |k| type_hash[@@storage_type_regex.match(k.to_s)[1]] = k }
  type_hash
end