Module: Snooby::Posts

Included in:
Domain, Subreddit, User
Defined in:
lib/snooby/actions.rb

Instance Method Summary collapse

Instance Method Details

#posts(count = 25, srlist = :posts) ⇒ Object Also known as: submissions

Returns an array of structs containing the calling object’s posts. Snooby-Plus adds the ‘srlist’ parameter. This can be any one of ‘:top’, ‘:new’, ‘:rising’, or ‘:contro’.



13
14
15
16
# File 'lib/snooby/actions.rb', line 13

def posts(count = 25, srlist = :posts)
  path = @name ? :"#{@kind}_#{@kind == :subreddit ? srlist : :posts}" : :reddit
  Snooby.build Post, path, @name, count
end