Sha256: a87cbf7ef441999340db5f5ebb545b284e8e35d2d2d9e3c61348f2eaa68535b5

Contents?: true

Size: 670 Bytes

Versions: 15

Compression:

Stored size: 670 Bytes

Contents

module Galakei
  module HelperMethods
    def self.included(klass) # :nodoc:
      klass.helper_method :galakei?
      klass.helper_method :emoji_table
    end 

    # Does the current request come from a galakei?
    def galakei?
      request.galakei?
    end

    # Returns the carrier specific {Emoji}[http://www.keitai-dev.net/Emoji]. Falls back to Unicode
    # emoji.
    # 
    #   emoji_table.white_smiling_face # "☺"
    def emoji_table
      if request.docomo?
        EmojiTable.docomo
      elsif request.softbank?
        EmojiTable.softbank
      elsif request.au?
        EmojiTable.au
      else
        EmojiTable.unicode
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
galakei-0.15.2 lib/galakei/helper_methods.rb
galakei-0.15.1 lib/galakei/helper_methods.rb
galakei-0.15.0 lib/galakei/helper_methods.rb
galakei-0.14.4 lib/galakei/helper_methods.rb
galakei-0.14.3 lib/galakei/helper_methods.rb
galakei-0.14.2 lib/galakei/helper_methods.rb
galakei-0.14.1 lib/galakei/helper_methods.rb
galakei-0.14.0 lib/galakei/helper_methods.rb
galakei-0.13.7 lib/galakei/helper_methods.rb
galakei-0.13.6 lib/galakei/helper_methods.rb
galakei-0.13.5 lib/galakei/helper_methods.rb
galakei-0.13.4 lib/galakei/helper_methods.rb
galakei-0.13.3 lib/galakei/helper_methods.rb
galakei-0.13.2 lib/galakei/helper_methods.rb
galakei-0.13.1 lib/galakei/helper_methods.rb