Sha256: 413a915bf4123c00d9aa6c42b528f3665e750dc660068b7c85bd916bbfeeaaaf

Contents?: true

Size: 828 Bytes

Versions: 4

Compression:

Stored size: 828 Bytes

Contents

# frozen_string_literal: true

module Redd
  module Models
    # Things that can be sent to a user's inbox.
    module Inboxable
      # Block the user that sent this item.
      def block
        client.post('/api/block', id: read_attribute(:name))
      end

      # Collapse the item.
      def collapse
        client.post('/api/collapse_message', id: read_attribute(:name))
      end

      # Uncollapse the item.
      def uncollapse
        client.post('/api/uncollapse_message', id: read_attribute(:name))
      end

      # Mark this thing as read.
      def mark_as_read
        client.post('/api/read_message', id: read_attribute(:name))
      end

      # Mark one or more messages as unread.
      def mark_as_unread
        client.post('/api/unread_message', id: read_attribute(:name))
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
spinels-redd-0.9.0 lib/redd/models/inboxable.rb
redd-0.9.0.pre.3 lib/redd/models/inboxable.rb
redd-0.9.0.pre.2 lib/redd/models/inboxable.rb
redd-0.9.0.pre.1 lib/redd/models/inboxable.rb