Module: Snooby::Reply
Instance Method Summary collapse
-
#reply(text) ⇒ Object
Posts a reply to the calling object, which is either a post or a comment.
Instance Method Details
#reply(text) ⇒ Object
Posts a reply to the calling object, which is either a post or a comment.
31 32 33 34 35 36 37 38 39 |
# File 'lib/snooby/actions.rb', line 31 def reply(text) raise RedditError, 'You are not logged in.' unless Snooby.active data = {:parent => self.name, :text => text, :api_type => 'json'} resp = Snooby.request(Paths[:comment], data) json = JSON.parse(resp)['json'] raise RedditError, jj(json) unless json['errors'].empty? end |