Sha256: 58ed3f1e719274049544abe4b90db8b8f8b0bfa69c333a5bb34f7fe2175b0a59
Contents?: true
Size: 653 Bytes
Versions: 11
Compression:
Stored size: 653 Bytes
Contents
module LearnWeb module ResponseParsable def self.included(base) base.class_eval do def parse! case response.status when 200 self.data = Oj.load(response.body, symbol_keys: true) populate_attributes! when 401 puts "It seems your OAuth token is incorrect. Please re-run config with: learn reset" exit when 500 puts "Something went wrong. Please try again." exit else puts "Something when wrong. Please try again." exit end self end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems