Sha256: 7f8e322a7db7b013287a38810ae7620d822a1060c1d3d5177e4eec420be7b4a8

Contents?: true

Size: 564 Bytes

Versions: 7

Compression:

Stored size: 564 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: get_attribute(:name))
      end

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
redd-0.8.8 lib/redd/models/inboxable.rb
redd-0.8.7 lib/redd/models/inboxable.rb
redd-0.8.6 lib/redd/models/inboxable.rb
redd-0.8.5 lib/redd/models/inboxable.rb
redd-0.8.4 lib/redd/models/inboxable.rb
redd-0.8.3 lib/redd/models/inboxable.rb
redd-0.8.2 lib/redd/models/inboxable.rb