Sha256: 468e92481d25b5f84f555f410f8fc23646b2f8beba67eb0df01944f551e0db05
Contents?: true
Size: 821 Bytes
Versions: 14
Compression:
Stored size: 821 Bytes
Contents
require 'bearcat/api_array' module Catalogcat class ApiArray < Bearcat::ApiArray def self.array_key(response) key = nil if response.env[:method] == :get path = response.env[:url].path key = 'courses' if path =~ %r{.*/courses} key = 'course' if path =~ %r{.*/courses/[0-9]*} key = 'catalogs' if path =~ %r{.*/catalogs} key = 'enrollments' if path =~ %r{.*/enrollments} key = 'order' if path =~ %r{.*/order/[0-9]*} key = 'orders' if path =~ %r{.*/orders} key = 'completed_certificates' if path =~ %r{.*/completed_certificates} key = 'user_registrations' if path =~ %r{.*/user_registrations} key = 'email_domain_sets' if path =~ %r{.*/email_domain_sets} end key.present? ? key : super(response) end end end
Version data entries
14 entries across 14 versions & 1 rubygems