class Bollettino::Generator
Generates an image from a slip.
@author Alessandro Desantis <desa.alessandro@gmail.com>
Attributes
options[R]
Public Class Methods
new(options = {})
click to toggle source
Initializes the generator.
@param options [Hash]
# File lib/bollettino/generator.rb, line 15 def initialize(options = {}) @options = options end
Public Instance Methods
generate!(slip, path)
click to toggle source
Generates the given slip.
@param slip [Bollettino::Slip] @param path [String]
# File lib/bollettino/generator.rb, line 23 def generate!(slip, path) image = MiniMagick::Image.open(File.expand_path('../../../assets/slip.png', __FILE__)) Bollettino::Renderer::Slip.render(image, slip) image.write path end