Method: LHS::Errors::Base#initialize
- Defined in:
- lib/lhs/errors/base.rb
#initialize(response = nil, record = nil) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/lhs/errors/base.rb', line 8 def initialize(response = nil, record = nil) @raw = response.body if response @record = record = (response) = (response) rescue JSON::ParserError = || {} = 'parse error' add_error(, 'body', 'parse error') end |