Module: Sinatra::Emoji::Helpers
- Defined in:
- lib/sinatra/emoji.rb
Instance Method Summary collapse
- #emoji(no) ⇒ Object
- #erb(template, opts = {}, locals = {}) ⇒ Object
- #haml(template, opts = {}, locals = {}) ⇒ Object
- #isAU ⇒ Object
- #isDocomo ⇒ Object
- #isSoftbank ⇒ Object
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 .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 .output_encoding_sjis html = parseEmoji(html) end |
#isAU ⇒ Object
31 32 33 |
# File 'lib/sinatra/emoji.rb', line 31 def isAU agent =~ /^UP.Browser|^KDDI/ end |
#isDocomo ⇒ Object
27 28 29 |
# File 'lib/sinatra/emoji.rb', line 27 def isDocomo agent =~ /^DoCoMo/ end |
#isSoftbank ⇒ Object
35 36 37 |
# File 'lib/sinatra/emoji.rb', line 35 def isSoftbank agent =~ /^J-PHONE|^Vodafone|^SoftBank/ end |