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