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.0.81 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.79 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.76 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.75 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.74 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.72 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.71 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.70 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.69 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.68 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.67 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.66 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.65 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.64 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.63 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.62 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.61 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.60 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.59 lib/bullet_train/core_ext/string_emoji_helper.rb
bullet_train-1.0.58 lib/bullet_train/core_ext/string_emoji_helper.rb