Class: Branding::Logo
- Inherits:
-
Object
- Object
- Branding::Logo
- Defined in:
- lib/branding/logo.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#algo ⇒ Object
Returns the value of attribute algo.
Instance Method Summary collapse
-
#initialize(path) ⇒ Logo
constructor
A new instance of Logo.
- #print ⇒ Object
Constructor Details
#initialize(path) ⇒ Logo
Returns a new instance of Logo.
5 6 7 8 9 |
# File 'lib/branding/logo.rb', line 5 def initialize(path) @algo = :normal @img = PNG.from_file(path) @canvas = Canvas.new(width: @img.width, height: @img.height) end |
Instance Attribute Details
#algo ⇒ Object
Returns the value of attribute algo.
3 4 5 |
# File 'lib/branding/logo.rb', line 3 def algo @algo end |
Instance Method Details
#print ⇒ Object
11 12 13 14 15 |
# File 'lib/branding/logo.rb', line 11 def print @canvas.load(@img.pixels, algo: @algo) @canvas.print nil end |