Class: DiscourseSubscriptionClient::NoticeSerializer

Inherits:
ApplicationSerializer
  • Object
show all
Defined in:
app/serializers/discourse_subscription_client/notice_serializer.rb

Instance Method Summary collapse

Instance Method Details

#can_hideObject



40
41
42
# File 'app/serializers/discourse_subscription_client/notice_serializer.rb', line 40

def can_hide
  object.can_hide?
end

#dismissableObject



36
37
38
# File 'app/serializers/discourse_subscription_client/notice_serializer.rb', line 36

def dismissable
  object.dismissable?
end

#include_resource?Boolean

Returns:

  • (Boolean)


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

def include_resource?
  object.resource.present?
end

#include_supplier?Boolean

Returns:

  • (Boolean)


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

def include_supplier?
  object.supplier.present?
end

#messsageObject



48
49
50
# File 'app/serializers/discourse_subscription_client/notice_serializer.rb', line 48

def messsage
  PrettyText.cook(object.message)
end

#notice_typeObject



44
45
46
# File 'app/serializers/discourse_subscription_client/notice_serializer.rb', line 44

def notice_type
  SubscriptionClientNotice.types.key(object.notice_type)
end

#plugin_status_resourceObject



32
33
34
# File 'app/serializers/discourse_subscription_client/notice_serializer.rb', line 32

def plugin_status_resource
  object.plugin_status_resource?
end