Module: Ronin::Support::Text::ERB::Mixin

Included in:
Mixin
Defined in:
lib/ronin/support/text/erb/mixin.rb

Overview

Mixin which adds erb helper methods.

Instance Method Summary collapse

Instance Method Details

#erb(path) ⇒ String

Renders the ERB template file.

Parameters:

  • path (String)

    The path to the ERB template file.

Returns:

  • (String)

    The rendered result.



38
39
40
41
42
# File 'lib/ronin/support/text/erb/mixin.rb', line 38

def erb(path)
  erb = ::ERB.new(File.read(path), trim_mode: '-')

  return erb.result(binding)
end