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.26 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.25 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.24 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.23 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.22 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.21 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.20 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.19 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.18 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.17 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.16 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.15 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.14 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.13 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.12 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.11 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.10 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.9 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.8 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.6.7 lib/bullet_train/core_ext/string_emoji_helper.rb