Module: MediaWiki::Query::Lists::Log::Protect

Included in:
MediaWiki::Query::Lists::Log
Defined in:
lib/mediawiki/query/lists/log/protect.rb

Instance Method Summary collapse

Instance Method Details

#get_modify_protection_log(user = nil, title = nil, start = nil, stop = nil, limit = @query_limit_default) ⇒ Array<Hash>

Gets protect/modify logs.

Parameters:

Returns:

  • (Array<Hash>)

    The events, containing the following keys: id, title, description, user, comment, timestamp, details.

See Also:

Since:

  • 0.10.0



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/mediawiki/query/lists/log/protect.rb', line 12

def get_modify_protection_log(user = nil, title = nil, start = nil, stop = nil, limit = @query_limit_default)
  response = get_log('protect/modify', user, title, start, stop,
                     limit)

  ret = []
  response['query']['logevents'].each do |log|
    ret << loghash_protect(log)
  end

  ret
end

#get_move_protected_log(user = nil, title = nil, start = nil, stop = nil, limit = @query_limit_default) ⇒ Array<Hash>

Gets protect/move_prot logs.

Parameters:

Returns:

  • (Array<Hash>)

    The events, containing the following keys: id, title, old_title, user, comment, timestamp.

See Also:

Since:

  • 0.10.0



30
31
32
33
34
35
36
37
38
39
# File 'lib/mediawiki/query/lists/log/protect.rb', line 30

def get_move_protected_log(user = nil, title = nil, start = nil, stop = nil, limit = @query_limit_default)
  resp = get_log('protect/move_prot', user, title, start, stop, limit)

  ret = []
  resp['query']['logevents'].each do |log|
    ret << loghash_protectmoveprot(log)
  end

  ret
end

#get_protect_log(user = nil, title = nil, start = nil, stop = nil, limit = @query_limit_default) ⇒ Array<Hash>

Gets protect/protect logs.

Parameters:

Returns:

  • (Array<Hash>)

    The events, containing the following keys: id, title, description, user, comment, timestamp, details.

See Also:

Since:

  • 0.10.0



47
48
49
50
51
52
53
54
55
56
# File 'lib/mediawiki/query/lists/log/protect.rb', line 47

def get_protect_log(user = nil, title = nil, start = nil, stop = nil, limit = @query_limit_default)
  response = get_log('protect/protect', user, title, start, stop, limit)

  ret = []
  response['query']['logevents'].each do |log|
    ret << loghash_protect(log)
  end

  ret
end

#get_unprotect_log(user = nil, title = nil, start = nil, stop = nil, limit = @query_limit_default) ⇒ Array<Hash>

Gets protect/unprotect logs.

Parameters:

Returns:

  • (Array<Hash>)

    The events, containing the following keys: id, title, user, comment, timestamp.

See Also:

Since:

  • 0.10.0



63
64
65
66
67
68
69
70
71
72
# File 'lib/mediawiki/query/lists/log/protect.rb', line 63

def get_unprotect_log(user = nil, title = nil, start = nil, stop = nil, limit = @query_limit_default)
  resp = get_log('protect/unprotect', user, title, start, stop, limit)

  ret = []
  resp['query']['logevents'].each do |log|
    ret << loghash_protectunprotect(log)
  end

  ret
end