Class: Hibp::Parsers::Breach

Inherits:
Json
  • Object
show all
Defined in:
lib/hibp/parsers/breach.rb

Overview

Hibp::Parsers::Breach

Used to convert raw API response data to the breach entity or
  array of the entities in case if response data contains multiple breaches

Instance Method Summary collapse

Instance Method Details

#parse_response(response) ⇒ Array<Hibp::Breach>, Hibp::Breach

Convert raw data to the breach entity

Parameters:

  • response (Faraday::Response)

    - Response that contains raw data for conversion

Returns:

  • (Array<Hibp::Breach>, Hibp::Breach)

See Also:



21
22
23
24
25
# File 'lib/hibp/parsers/breach.rb', line 21

def parse_response(response)
  super(response) do |attributes|
    Models::Breach.new(convert_dates!(attributes))
  end
end