Class: Generamba::TemplateInstallerFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/generamba/template/installer/template_installer_factory.rb

Overview

Factory that creates a proper installer for a given template type

Instance Method Summary collapse

Instance Method Details

#installer_for_type(type) ⇒ Object

Provides the appropriate strategy for a given template type



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generamba/template/installer/template_installer_factory.rb', line 9

def installer_for_type(type)
  case type
    when TemplateDeclarationType::LOCAL_TEMPLATE
      return Generamba::LocalInstaller.new
    when TemplateDeclarationType::REMOTE_TEMPLATE
      return Generamba::RemoteInstaller.new
    when TemplateDeclarationType::CATALOG_TEMPLATE
      return Generamba::CatalogInstaller.new
    else
      return nil
  end
end