Class: Prawn::Emoji::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/prawn/emoji/image.rb

Constant Summary collapse

STORE =
Emoji.root.join 'emoji', 'images'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unicode) ⇒ Image

Returns a new instance of Image.



13
14
15
# File 'lib/prawn/emoji/image.rb', line 13

def initialize(unicode)
  @unicode = unicode
end

Instance Attribute Details

#unicodeObject (readonly)

Returns the value of attribute unicode.



11
12
13
# File 'lib/prawn/emoji/image.rb', line 11

def unicode
  @unicode
end

Instance Method Details

#==(other) ⇒ Object



21
22
23
# File 'lib/prawn/emoji/image.rb', line 21

def ==(other)
  unicode == other.unicode
end

#pathObject



17
18
19
# File 'lib/prawn/emoji/image.rb', line 17

def path
  STORE.join("#{unicode.codepoint}.png").to_s
end