Class: WatchedWordSerializer

Inherits:
ApplicationSerializer show all
Defined in:
app/serializers/watched_word_serializer.rb

Instance Method Summary collapse

Methods inherited from ApplicationSerializer

expire_cache_fragment!, fragment_cache

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#actionObject



10
11
12
# File 'app/serializers/watched_word_serializer.rb', line 10

def action
  WatchedWord.actions[object.action]
end

#include_replacement?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/serializers/watched_word_serializer.rb', line 14

def include_replacement?
  WatchedWord.has_replacement?(action)
end

#regexpObject



6
7
8
# File 'app/serializers/watched_word_serializer.rb', line 6

def regexp
  WordWatcher.word_to_regexp(word, engine: :js)
end