Module: Redd::Clients::Base::Submit

Included in:
Redd::Clients::Base
Defined in:
lib/redd/clients/base/submit.rb

Overview

Methods that require the “submit” scope

Instance Method Summary collapse

Instance Method Details

#add_comment(thing, text) ⇒ Objects::Comment, Objects::PrivateMessage

Add a comment to a link, reply to a comment or reply to a message. Bit of an all-purpose method, this one.

Parameters:

Returns:



12
13
14
15
# File 'lib/redd/clients/base/submit.rb', line 12

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