Class: ReviewableExplanationSerializer

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

Instance Method Summary collapse

Methods inherited from ApplicationSerializer

expire_cache_fragment!, fragment_cache

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#hide_post_scoreObject



12
13
14
# File 'app/serializers/reviewable_explanation_serializer.rb', line 12

def hide_post_score
  Reviewable.score_required_to_hide_post
end

#idObject



8
9
10
# File 'app/serializers/reviewable_explanation_serializer.rb', line 8

def id
  object[:reviewable].id
end

#min_score_visibilityObject



20
21
22
# File 'app/serializers/reviewable_explanation_serializer.rb', line 20

def min_score_visibility
  Reviewable.min_score_for_priority
end

#scoresObject



28
29
30
# File 'app/serializers/reviewable_explanation_serializer.rb', line 28

def scores
  object[:scores]
end

#spam_silence_scoreObject



16
17
18
# File 'app/serializers/reviewable_explanation_serializer.rb', line 16

def spam_silence_score
  Reviewable.spam_score_to_silence_new_user
end

#total_scoreObject



24
25
26
# File 'app/serializers/reviewable_explanation_serializer.rb', line 24

def total_score
  object[:reviewable].score
end