Class: InstagramConnect::Message
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- InstagramConnect::Message
- Defined in:
- app/models/instagram_connect/message.rb
Overview
One message bubble in a DM thread (or a story reply mirrored as a DM).
Constant Summary collapse
- DIRECTIONS =
%w[inbound outbound].freeze
- STATUSES =
%w[received pending sending sent failed].freeze
- KINDS =
%w[dm story_reply reaction].freeze
- SOURCES =
%w[inbound manual api operator_app].freeze
- MEDIA_STATUSES =
%w[none pending downloadable attached unavailable].freeze
- PREVIEW_LIMIT =
140
Instance Method Summary collapse
- #inbound? ⇒ Boolean
- #outbound? ⇒ Boolean
-
#preview ⇒ Object
Short summary used for the inbox row preview.
Instance Method Details
#inbound? ⇒ Boolean
23 24 25 |
# File 'app/models/instagram_connect/message.rb', line 23 def inbound? direction == "inbound" end |
#outbound? ⇒ Boolean
27 28 29 |
# File 'app/models/instagram_connect/message.rb', line 27 def outbound? direction == "outbound" end |
#preview ⇒ Object
Short summary used for the inbox row preview.
32 33 34 35 |
# File 'app/models/instagram_connect/message.rb', line 32 def preview return body.to_s.truncate(PREVIEW_LIMIT) if body.present? "[#{kind}]" end |