Class: Bollettino::Generator
- Inherits:
-
Object
- Object
- Bollettino::Generator
- Defined in:
- lib/bollettino/generator.rb
Overview
Generator
Generates an image from a slip.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#generate!(slip, path) ⇒ Object
Generates the given slip.
-
#initialize(options = {}) ⇒ Generator
constructor
Initializes the generator.
Constructor Details
#initialize(options = {}) ⇒ Generator
Initializes the generator.
15 16 17 |
# File 'lib/bollettino/generator.rb', line 15 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/bollettino/generator.rb', line 10 def @options end |
Instance Method Details
#generate!(slip, path) ⇒ Object
Generates the given slip.
23 24 25 26 27 |
# File 'lib/bollettino/generator.rb', line 23 def generate!(slip, path) image = MiniMagick::Image.open(File.('../../../assets/slip.png', __FILE__)) Bollettino::Renderer::Slip.render(image, slip) image.write path end |