Class: Hanami::Generators::TemplateEngine

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/generators/template_engine.rb

Defined Under Namespace

Classes: UnsupportedTemplateEngine

Constant Summary collapse

SUPPORTED_ENGINES =
%w(erb haml slim).freeze
DEFAULT_ENGINE =
'erb'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hanamirc, engine) ⇒ TemplateEngine

Returns a new instance of TemplateEngine


12
13
14
15
# File 'lib/hanami/generators/template_engine.rb', line 12

def initialize(hanamirc, engine)
  @name = (engine || hanamirc.options.fetch(:template))
  assert_engine!
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


10
11
12
# File 'lib/hanami/generators/template_engine.rb', line 10

def name
  @name
end