class Rebi::ErbHelper
Public Class Methods
new(input, env_conf)
click to toggle source
# File lib/rebi/erb_helper.rb, line 3 def initialize input, env_conf @input = input @env = env_conf.environment_variables || {} @options = env_conf.options end
Public Instance Methods
rebi()
click to toggle source
# File lib/rebi/erb_helper.rb, line 13 def rebi OpenStruct.new ({ env: @env, opts: @options, options: @options, }) end
rebi_env(k=nil)
click to toggle source
# File lib/rebi/erb_helper.rb, line 9 def rebi_env k=nil k.present? ? @env[k] : @env end
result()
click to toggle source
# File lib/rebi/erb_helper.rb, line 21 def result ERB.new(@input).result(binding) end