Sha256: 587fe5ff302b9ee21f52037981b6fc503214cdf4b8f3e08d8eb64bfbf9d30c33
Contents?: true
Size: 899 Bytes
Versions: 8
Compression:
Stored size: 899 Bytes
Contents
module AbsorbApi class Collection < ::Array attr_reader :metadata def initialize(elements, metadata = {}) super(elements) @metadata = metadata end # private # def method_missing(method_name, *arguments, &block) # if "AbsorbApi::#{metadata[:klass]}".constantize.new.respond_to? method_name # collection = [] # Base.api.in_parallel do # self.each do |object| # collection << Base.api.get("#{metadata[:klass].to_s.pluralize}/#{object.id}/#{method_name}") # end # end # collection.map { |response| response.body.map { |attrs| CourseEnrollment.new(attrs) } }.flatten # else # super # end # end # # def respond_to_missing?(method_name, include_private = false) # self.first.respond_to? method_name || super # end end end
Version data entries
8 entries across 8 versions & 1 rubygems