class Memerator::Report

A report!

Public Class Methods

new(data) click to toggle source

@!visibility private

# File lib/memerator/report.rb, line 4
def initialize(data)
  @data = data
end

Public Instance Methods

assigned?() click to toggle source

@return [true, false] if the report is assigned to someone

# File lib/memerator/report.rb, line 55
def assigned?
  status == 1
end
assignee() click to toggle source

@return [User] the staff member assigned to this report @return [nil] if no one is assigned.

# File lib/memerator/report.rb, line 38
def assignee
  return nil if @data['assignee'].nil?

  Memerator::User.new(@data['assignee'])
end
closed?() click to toggle source

@return [true, false] if the report is closed

# File lib/memerator/report.rb, line 60
def closed?
  status == 2
end
comment() click to toggle source

@return [String, nil] the staff member's comment, if they responded.

# File lib/memerator/report.rb, line 45
def comment
  @data['comment']
end
description() click to toggle source

@return [String] more detailed explanation

# File lib/memerator/report.rb, line 32
def description
  @data['message']['description']
end
id() click to toggle source

@return [Integer] the report ID.

# File lib/memerator/report.rb, line 9
def id
  @data['id']
end
memeid() click to toggle source

@return [String] the ID of the meme being reported.

# File lib/memerator/report.rb, line 22
def memeid
  @data['memeid']
end
open?() click to toggle source

@return [true, false] if the report is open

# File lib/memerator/report.rb, line 50
def open?
  status == 0
end
reason() click to toggle source

@return [String] the reason for the report.

# File lib/memerator/report.rb, line 27
def reason
  @data['message']['reason']
end
status() click to toggle source

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.

# File lib/memerator/report.rb, line 17
def status
  @data['status']
end