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.11.0 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.10.0 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.9.0 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.8.5 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.8.4 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.8.3 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.8.2 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.8.1 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.8.0 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.23 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.22 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.21 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.20 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.19 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.18 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.17 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.16 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.15 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.14 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.7.13 lib/bullet_train/core_ext/string_emoji_helper.rb