class Confer::Configurator

Public: Encapsulates the actual interaction with the remote server.

Public Class Methods

get(name, options = {}) click to toggle source

Public: Find and instantiate a Configurator with the given name.

name - A String containing the name of the configurator to get. options - A Hash of options to pass to the configurator.

Raises

ConfiguratorNotFoundError - If a configurator with the specified name can

not be located.

ConfiguratorError - If the configurator was found byt cannot be

instantiated for some reason.

Returns a Configurator instance if found.

# File lib/confer/configurator.rb, line 28
def self.get(name, options = {})
  require "confer/configurators/#{name}"
  Confer::Configurators.const_get(name.camelize).new(options)
rescue LoadError => e
  raise ConfiguratorNotFoundError.new("Configurator #{name} not found")
rescue StandardError => e
  raise ConfiguratorError.new(e)
end
new(options = {}) click to toggle source

Public: Instantiates a new Configurator. By itself this method doesn’t really do very much for the base class, however for subclasses it will attempt to apply the options passed to attributes if they exist.

options - A Hash of configurator specific options.

# File lib/confer/configurator.rb, line 44
def initialize(options = {})
  options.apply_to self
end

Public Instance Methods

apply(connection) click to toggle source

Public: Modify the remote configuration to match the Configurator attributes.

# File lib/confer/configurator.rb, line 61
def apply(connection); end
query(connection) click to toggle source

Public: Query and return the remote configuration.

# File lib/confer/configurator.rb, line 51
def query(connection); end
verify(connection) click to toggle source

Public: Verify the remote configuration against the Configurator attributes.

# File lib/confer/configurator.rb, line 56
def verify(connection); end