Module: Weasyl::Messages
- Defined in:
- lib/weasyl/messages.rb
Overview
Helper module to fetch information about messages.
Defined Under Namespace
Classes: Summary
Class Method Summary collapse
-
.submissions(count = 100, backtime = 0, nexttime = Time.now.to_i) ⇒ Weasyl::SubmissionList
Fetch a list of submissions for the currently logged in user returned are returned submissions.
-
.summary ⇒ Weasyl::Messages::Summary
Fetch a summary of new message counts.
Class Method Details
.submissions(count = 100, backtime = 0, nexttime = Time.now.to_i) ⇒ Weasyl::SubmissionList
Fetch a list of submissions for the currently logged in user returned are returned submissions. While the non-block version only returns 100 submissions at all.
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/weasyl/messages.rb', line 46 def self.submissions(count = 100, backtime = 0, nexttime = Time.now.to_i) params = { count: count, backtime: backtime, nexttime: nexttime } subs = nil loop do subs = fetch_subs(params) break if subs[:nexttime].nil? || !block_given? subs[:submissions].each { |s| yield s } params[:nexttime] = subs[:nexttime] end subs end |