Class: Branding::Logo

Inherits:
Object
  • Object
show all
Defined in:
lib/branding/logo.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#algoObject

Returns the value of attribute algo.



3
4
5
# File 'lib/branding/logo.rb', line 3

def algo
  @algo
end

Instance Method Details



11
12
13
14
15
# File 'lib/branding/logo.rb', line 11

def print
  @canvas.load(@img.pixels, algo: @algo)
  @canvas.print
  nil
end