Class: Emoji

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

Direct Known Subclasses

DoCoMo, Google, KDDI, Softbank

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(type) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/emoji.rb', line 2

def self.create type
  warn "Please note that the emoji gem is completely different in 1.0. See https://github.com/steveklabnik/emoji/releases/tag/v1.0.0 for more details."
  case type
  when :iphone
	# The iPhone implements the Softbank Unicode private space
    Softbank.new
  when :softbank
    Softbank.new
when :docomo
	DoCoMo.new
when :kddi
	KDDI.new
when :au
	# Known as "Au by KDDI"
	KDDI.new
when :google
	Google.new
  else
    raise "Not supported."
  end
end

Instance Method Details

#convert_unicode_to_hex(unicode) ⇒ Object



24
25
26
# File 'lib/emoji.rb', line 24

def convert_unicode_to_hex(unicode)
  return [unicode.to_i(16)].pack("U")
end

#get_this_methodObject



32
33
34
# File 'lib/emoji.rb', line 32

def get_this_method
   return caller[0][/`([^']*)'/, 1]
end

#warning(character) ⇒ Object



28
29
30
# File 'lib/emoji.rb', line 28

def warning(character)
	STDERR.puts "WARNING: Emoji character \"#{character}\" not supported."
end