Sha256: b1b3223e1b3f314686d25e932f4ded89d0879fb9009c26ff826188759fd39b16
Contents?: true
Size: 751 Bytes
Versions: 14
Compression:
Stored size: 751 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} end key.present? ? key : super(response) end end end
Version data entries
14 entries across 14 versions & 1 rubygems