class Dumpman::Fetcher

Public Class Methods

fetch(connection_name) click to toggle source
# File lib/dumpman/fetcher.rb, line 3
def self.fetch(connection_name)
  connection = Dumpman.connections.find do |connection|
    connection.name == connection_name
  end

  instance = self.new(attrs: connection.attrs)
  instance.fetch_remote_dump
end

Public Instance Methods

fetch_remote_dump() click to toggle source
# File lib/dumpman/fetcher.rb, line 12
def fetch_remote_dump
  fetcher = fetcher_class.new(attrs)
  fetcher.get_dump
end

Private Instance Methods

fetcher_class() click to toggle source
# File lib/dumpman/fetcher.rb, line 19
def fetcher_class
  case attrs[:fetch_strategy]
  when :docker then Dumpman::Fetchers::Docker
  when :direct then Dumpman::Fetchers::Direct
  else
    Dumpman::Fetchers::Direct
  end
end