Sha256: 448daa2a97f76ab5067ee4e5bc96bc6f043a69c9a71d2561eaa343db3ea83583

Contents?: true

Size: 342 Bytes

Versions: 186

Compression:

Stored size: 342 Bytes

Contents

require "unicode/emoji"

module BulletTrain
  module CoreExt
    module StringEmojiHelper
      def strip_emojis
        gsub(Unicode::Emoji::REGEX, "")
      end

      def only_emoji?
        return false if strip.empty?
        strip_emojis.strip.empty?
      end
    end
  end
end

String.include(BulletTrain::CoreExt::StringEmojiHelper)

Version data entries

186 entries across 186 versions & 1 rubygems

Version Path
bullet_train-1.6.6 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.5 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.4 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.3 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.2 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.1 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.0 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.5.2 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.5.1 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.5.0 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.4.11 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.4.10 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.4.9 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.4.8 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.4.7 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.4.6 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.4.5 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.4.4 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.4.3 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.4.2 lib/bullet_train/core_ext/string_emoji_helper.rb