Class: ReviewableScoreTypeSerializer

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

Instance Method Summary collapse

Methods inherited from ApplicationSerializer

expire_cache_fragment!, fragment_cache

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#iconObject



23
24
25
# File 'app/serializers/reviewable_score_type_serializer.rb', line 23

def icon
  "flag"
end

#include_reviewable_priority?Boolean

Returns:

  • (Boolean)


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

def include_reviewable_priority?
  object.respond_to?(:reviewable_priority)
end

#reviewable_priorityObject



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

def reviewable_priority
  object.reviewable_priority.to_i
end

#titleObject

Allow us to share post action type translations for backwards compatibility



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

def title
  ReviewableScore.type_title(type)
end

#typeObject



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

def type
  ReviewableScore.types[id]
end