Class: CodeTemplater
- Inherits:
-
Object
- Object
- CodeTemplater
- Defined in:
- lib/ccios/code_templater.rb
Instance Method Summary collapse
- #content_for_suffix(prefix, suffix) ⇒ Object
-
#initialize(options = {}) ⇒ CodeTemplater
constructor
A new instance of CodeTemplater.
Constructor Details
#initialize(options = {}) ⇒ CodeTemplater
Returns a new instance of CodeTemplater.
5 6 7 |
# File 'lib/ccios/code_templater.rb', line 5 def initialize( = {}) = end |
Instance Method Details
#content_for_suffix(prefix, suffix) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/ccios/code_templater.rb', line 9 def content_for_suffix(prefix, suffix) template_name = suffix.underscore = .merge({name: prefix, lowercased_name: prefix.camelize(:lower)}) template_file = File.join(File.dirname(__FILE__), "templates/#{template_name}.mustache") Mustache.render(File.read(template_file), ) end |