class Bosh::AwsCliPlugin::MigrationHelper::Template
Attributes
class_name[R]
name[R]
timestamp_string[R]
Public Class Methods
new(name)
click to toggle source
# File lib/bosh_cli_plugin_aws/migration_helper.rb, line 7 def initialize(name) @timestamp_string = Time.new.getutc.strftime("%Y%m%d%H%M%S") @name = name @class_name = MigrationHelper.to_class_name(name) end
Public Instance Methods
file_prefix()
click to toggle source
# File lib/bosh_cli_plugin_aws/migration_helper.rb, line 13 def file_prefix "#{timestamp_string}_#{name}" end
render(template_name = "aws_migration")
click to toggle source
# File lib/bosh_cli_plugin_aws/migration_helper.rb, line 17 def render(template_name = "aws_migration") template_file_path = File.expand_path("../../templates/#{template_name}.erb", File.dirname(__FILE__)) template = ERB.new(File.new(template_file_path).read(), 0, '<>%-') template.result(binding) end