Sha256: 2bb70afa8c9a7d3265aace4bb139e19edeb66d5abd47eeb8f96e30ef915c5dec
Contents?: true
Size: 648 Bytes
Versions: 9
Compression:
Stored size: 648 Bytes
Contents
module LearnWeb class Client module Environment class Verification attr_reader :response attr_accessor :message, :status def initialize(response) @response = response parse! end def success? status == 200 end private def parse! self.status = response.status begin body = Oj.load(response.body, symbol_keys: true) self.message = body[:message] rescue self.message = 'Sorry, something went wrong. Please try again.' end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems