Class: Rubyhexagon::Search::FlagHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyhexagon/search/flag_history.rb

Overview

Class to hold methods for fetching a list of flagged posts.

Author:

  • Maxine Michalski

Since:

  • 1.4.0

Class Method Summary collapse

Class Method Details

.list(page = 1) ⇒ Array<DeletedPost>

Retrieve a list of flagged posts, with flag reason. Only id and del_reason is present. This method accepts blocks and only returns one page without blocks

Parameters:

  • page (Integer) (defaults to: 1)

    page of deleted posts to return

Returns:

Author:

  • Maxine Michalski

Since:

  • 1.4.0



39
40
41
42
43
44
45
46
47
# File 'lib/rubyhexagon/search/flag_history.rb', line 39

def self.list(page = 1)
  d = fetch_list(page)
  while block_given? && d != []
    d.each { |del| yield del }
    page += 1
    d = fetch_list(page)
  end
  d
end