Class: Hibp::Parsers::Password
- Inherits:
-
Object
- Object
- Hibp::Parsers::Password
- Defined in:
- lib/hibp/parsers/password.rb
Overview
Parsers::Password
Used to parse raw data and convert it to the password models
Constant Summary collapse
- ROWS_SPLITTER =
"\r\n"
- ATTRIBUTES_SPLITTER =
':'
Instance Method Summary collapse
-
#parse_response(response) ⇒ Array<Hibp::Models::Password>
Convert API response raw data to the passwords models.
Instance Method Details
#parse_response(response) ⇒ Array<Hibp::Models::Password>
Convert API response raw data to the passwords models.
21 22 23 24 25 |
# File 'lib/hibp/parsers/password.rb', line 21 def parse_response(response) data = response.body data.split(ROWS_SPLITTER).map(&method(:convert_to_password)) end |