Class: DiscourseSubscriptionClient::NoticeSerializer
- Inherits:
-
ApplicationSerializer
- Object
- ApplicationSerializer
- DiscourseSubscriptionClient::NoticeSerializer
- Defined in:
- app/serializers/discourse_subscription_client/notice_serializer.rb
Instance Method Summary collapse
- #can_hide ⇒ Object
- #dismissable ⇒ Object
- #include_resource? ⇒ Boolean
- #include_supplier? ⇒ Boolean
- #messsage ⇒ Object
- #notice_type ⇒ Object
- #plugin_status_resource ⇒ Object
Instance Method Details
#can_hide ⇒ Object
40 41 42 |
# File 'app/serializers/discourse_subscription_client/notice_serializer.rb', line 40 def can_hide object.can_hide? end |
#dismissable ⇒ Object
36 37 38 |
# File 'app/serializers/discourse_subscription_client/notice_serializer.rb', line 36 def dismissable object.dismissable? end |
#include_resource? ⇒ 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
24 25 26 |
# File 'app/serializers/discourse_subscription_client/notice_serializer.rb', line 24 def include_supplier? object.supplier.present? end |
#messsage ⇒ Object
48 49 50 |
# File 'app/serializers/discourse_subscription_client/notice_serializer.rb', line 48 def messsage PrettyText.cook(object.) end |
#notice_type ⇒ Object
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_resource ⇒ Object
32 33 34 |
# File 'app/serializers/discourse_subscription_client/notice_serializer.rb', line 32 def plugin_status_resource object.plugin_status_resource? end |