Class: Memerator::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/memerator/report.rb

Overview

A report!

Instance Method Summary collapse

Instance Method Details

#assigned?true, false

Returns if the report is assigned to someone.

Returns:

  • (true, false)

    if the report is assigned to someone


55
56
57
# File 'lib/memerator/report.rb', line 55

def assigned?
  status == 1
end

#assigneeUser?

Returns:

  • (User)

    the staff member assigned to this report

  • (nil)

    if no one is assigned.


38
39
40
41
42
# File 'lib/memerator/report.rb', line 38

def assignee
  return nil if @data['assignee'].nil?

  Memerator::User.new(@data['assignee'])
end

#closed?true, false

Returns if the report is closed.

Returns:

  • (true, false)

    if the report is closed


60
61
62
# File 'lib/memerator/report.rb', line 60

def closed?
  status == 2
end

#commentString?

Returns the staff member's comment, if they responded.

Returns:

  • (String, nil)

    the staff member's comment, if they responded.


45
46
47
# File 'lib/memerator/report.rb', line 45

def comment
  @data['comment']
end

#descriptionString

Returns more detailed explanation.

Returns:

  • (String)

    more detailed explanation


32
33
34
# File 'lib/memerator/report.rb', line 32

def description
  @data['message']['description']
end

#idInteger

Returns the report ID.

Returns:

  • (Integer)

    the report ID.


9
10
11
# File 'lib/memerator/report.rb', line 9

def id
  @data['id']
end

#memeidString

Returns the ID of the meme being reported.

Returns:

  • (String)

    the ID of the meme being reported.


22
23
24
# File 'lib/memerator/report.rb', line 22

def memeid
  @data['memeid']
end

#open?true, false

Returns if the report is open.

Returns:

  • (true, false)

    if the report is open


50
51
52
# File 'lib/memerator/report.rb', line 50

def open?
  status == 0
end

#reasonString

Returns the reason for the report.

Returns:

  • (String)

    the reason for the report.


27
28
29
# File 'lib/memerator/report.rb', line 27

def reason
  @data['message']['reason']
end

#statusObject

The status of the meme. Used to see where the report is. Status 0 means it's open and unclaimed Status 1 means it's claimed, but not settled. Status 2 means it's resolved.


17
18
19
# File 'lib/memerator/report.rb', line 17

def status
  @data['status']
end