Class: MVCLI::ERBExtension

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Inflector
Defined in:
lib/mvcli/std/extensions/erb_extension.rb

Instance Method Summary collapse

Instance Method Details

#define(name, bytes, extension_type, namespace) ⇒ Object



11
12
13
14
15
# File 'lib/mvcli/std/extensions/erb_extension.rb', line 11

def define(name, bytes, extension_type, namespace)
  check! extension_type
  erb = MVCLI::ERB.new
  erb.compile bytes, to_path(name, extension_type)
end

#to_path(name, extension_type) ⇒ Object



6
7
8
9
# File 'lib/mvcli/std/extensions/erb_extension.rb', line 6

def to_path(name, extension_type)
  check! extension_type
  "#{pluralize extension_type}/#{name}.txt.erb"
end