Class: EmailLogSerializer

Inherits:
ApplicationSerializer show all
Includes:
EmailLogsMixin
Defined in:
app/serializers/email_log_serializer.rb

Instance Method Summary collapse

Methods included from EmailLogsMixin

#include_post_description?, #include_post_url?, included, #post_description, #post_url

Methods inherited from ApplicationSerializer

expire_cache_fragment!, fragment_cache

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#has_bounce_keyObject



19
20
21
# File 'app/serializers/email_log_serializer.rb', line 19

def has_bounce_key
  object.bounce_key.present?
end

#include_reply_key?Boolean

Returns:

  • (Boolean)


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

def include_reply_key?
  reply_keys = @options[:reply_keys]
  reply_keys.present? && reply_keys[[object.post_id, object.user_id]]
end

#reply_keyObject



15
16
17
# File 'app/serializers/email_log_serializer.rb', line 15

def reply_key
  @options[:reply_keys][[object.post_id, object.user_id]].delete("-")
end