class Ec2::ErbProfile

Attributes

api[RW]

Public Class Methods

new(file, api: nil) click to toggle source
# File lib/ec2/erb_profile.rb, line 13
def initialize(file, api: nil)
  @file = file
  @api = api
end

Public Instance Methods

binding() click to toggle source
# File lib/ec2/erb_profile.rb, line 18
def binding
  api.instance_eval { binding }
end
render() click to toggle source
# File lib/ec2/erb_profile.rb, line 22
def render
  erb = ERB.new(File.read(@file), nil, '-')
  erb.result(binding)
rescue => e
  error "while rendering erb file #{@file}"
end