class CloudflareAPIError

Attributes

errors[RW]
status_code[RW]
success[RW]
url[RW]

Public Class Methods

new(url, response, content) click to toggle source
# File lib/logstash/inputs/cloudflare.rb, line 15
def initialize(url, response, content)
  begin
    json_data = JSON.parse(content)
  rescue JSON::ParserError
    json_data = {}
  end
  @url = url
  @success = json_data.fetch('success', false)
  @errors = json_data.fetch('errors', [])
  @status_code = response.code
end