Module: Sinatra::Emoji::Helpers

Defined in:
lib/sinatra/emoji.rb

Instance Method Summary collapse

Instance Method Details

#emoji(no) ⇒ Object



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

def emoji(no)
  "{$#{no}}"
end

#erb(template, opts = {}, locals = {}) ⇒ Object



15
16
17
18
19
# File 'lib/sinatra/emoji.rb', line 15

def erb(template, opts={}, locals={})
  html = __erb__(template, opts, locals)
  html = NKF.nkf('-s -x', html) if options.output_encoding_sjis
  parseEmoji(html)
end

#haml(template, opts = {}, locals = {}) ⇒ Object



21
22
23
24
25
# File 'lib/sinatra/emoji.rb', line 21

def haml(template, opts={}, locals={})
  html = __haml__(template, opts, locals)
  html = NKF.nkf('-s -x', html) if options.output_encoding_sjis
  html = parseEmoji(html)
end

#isAUObject



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

def isAU
  agent =~ /^UP.Browser|^KDDI/
end

#isDocomoObject



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

def isDocomo
  agent =~ /^DoCoMo/
end

#isSoftbankObject



35
36
37
# File 'lib/sinatra/emoji.rb', line 35

def isSoftbank
  agent =~ /^J-PHONE|^Vodafone|^SoftBank/
end