-
-
Save anonymous/babf8b848aeb2562374d28ec48830d9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Report | |
include ERB::Util | |
attr_reader :everthing, :template | |
def initialize(args) | |
serial = SERIAL | |
output_file = args[:output_file] or raise ArgumentError, 'Failed to specify the output pdf file in arguments.' | |
@tmpl_file = args[:template] or raise ArgumentError, 'Failed to specify the template to use for rendering.' | |
@everything = Target::GatherData.new(serial).aggregated | |
end | |
def render | |
template = File.read(@tmpl_file).chomp | |
layout = ERB.new(template, 0, '') | |
layout.result(binding) # always get NoMethodError: undefined method `[]' for nil:NilClass | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment