Sha256: 16998b0523d17ad9ee39c6ba796a3bda8b522945e9fe53270407d51c4af8c66a

Contents?: true

Size: 493 Bytes

Versions: 7

Compression:

Stored size: 493 Bytes

Contents

# frozen_string_literal: true

module Redd
  module Models
    # A model that can be commented on or replied to.
    module Replyable
      # Add a comment to a link, reply to a comment or reply to a message.
      # @param text [String] the text to comment
      # @return [Comment, PrivateMessage] The created reply.
      def reply(text)
        fullname = get_attribute(:name)
        @client.model(:post, '/api/comment/', text: text, thing_id: fullname).first
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
redd-0.8.4 lib/redd/models/replyable.rb
redd-0.8.3 lib/redd/models/replyable.rb
redd-0.8.2 lib/redd/models/replyable.rb
redd-0.8.1 lib/redd/models/replyable.rb
redd-0.8.0 lib/redd/models/replyable.rb
redd-0.8.0.pre.2 lib/redd/models/replyable.rb
redd-0.8.0.pre.1 lib/redd/models/replyable.rb