Class: WebammToRails::Sources::Gemfile::Definition
- Inherits:
-
Object
- Object
- WebammToRails::Sources::Gemfile::Definition
- Defined in:
- lib/webamm_to_rails/sources/gemfile/definition.rb
Instance Method Summary collapse
-
#initialize(waml_definition:) ⇒ Definition
constructor
A new instance of Definition.
- #render ⇒ Object
Constructor Details
#initialize(waml_definition:) ⇒ Definition
Returns a new instance of Definition.
9 10 11 |
# File 'lib/webamm_to_rails/sources/gemfile/definition.rb', line 9 def initialize(waml_definition:) @waml_definition = waml_definition end |
Instance Method Details
#render ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/webamm_to_rails/sources/gemfile/definition.rb', line 13 def render template_path = File.('template.erb', __dir__) template_content = File.read(template_path) raw_content = ERB.new(template_content, trim_mode: '-').result(instance_eval { binding }) ::WebammToRails::Utils::FormatCode.call(raw_content) end |