Class List Method List File List

# Class: UpdaterFactory

Inherits:
  Object
  - Object
  - UpdaterFactory
  show all
Defined in:
  lib/common/updater/updater_factory.rb

## Class Method Summary (collapse)

- + (Object) available_updaters_classes protected

  return array of class symbols.

- + (Object) get_updater(repo_directory)

## Class Method Details

### + (`Object`) available_updaters_classes (protected)

return array of class symbols

    19
    20
    21
    # File 'lib/common/updater/updater_factory.rb', line 19

    def self.available_updaters_classes
      Object.constants.grep(/^.+Updater$/)
    end

### + (`Object`) get_updater(repo_directory)

    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    # File 'lib/common/updater/updater_factory.rb', line 5

    def self.get_updater(repo_directory)
      self.available_updaters_classes().each do |updater_symbol|
        updater = Object.const_get(updater_symbol).new(repo_directory)

        if updater.is_installed?
          return updater
        end
      end
      nil
    end