Sha256: ba4d06ba14f884d2ddeb65cc692bc58cc0db045f5461c7067ae8ce5977618c36

Contents?: true

Size: 737 Bytes

Versions: 5

Compression:

Stored size: 737 Bytes

Contents

module Redd
  module Clients
    class Base
      # Methods that require the "submit" scope
      module Submit
        # Add a comment to a link, reply to a comment or reply to a message.
        # Bit of an all-purpose method, this one.
        # @param thing [Objects::Submission, Objects::Comment,
        #   Objects::PrivateMessage] A thing to add a comment to.
        # @param text [String] The text to comment.
        # @return [Objects::Comment, Objects::PrivateMessage] The reply.
        def add_comment(thing, text)
          response = post("/api/comment", text: text, thing_id: thing.fullname)
          object_from_body(response.body[:json][:data][:things][0])
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
redd-0.7.8 lib/redd/clients/base/submit.rb
redd-0.7.7 lib/redd/clients/base/submit.rb
redd-0.7.6 lib/redd/clients/base/submit.rb
redd-0.7.5 lib/redd/clients/base/submit.rb
redd-0.7.4 lib/redd/clients/base/submit.rb