Sha256: 6cefc0b89b2b8e8342d3a5b0bb9216c343978755ae574ca76f0466f6dbac79e5
Contents?: true
Size: 1.18 KB
Versions: 1
Compression:
Stored size: 1.18 KB
Contents
module AbsorbApi class Course < Base include Relations attr_accessor :id, :name, :description, :notes, :external_id, :access_date, :expire_type, :expire_duration, :expiry_date, :active_status, :tag_ids, :resource_ids, :editor_ids, :prices, :competency_definition_ids, :prerequisite_course_ids, :post_enrollment_course_ids, :allow_course_evaluation, :category_id, :certificate_url, :audience, :goals, :vendor, :company_cost, :learner_cost, :company_time, :learner_time has_many :certificates has_many :chapters has_many :enrollments, :course_enrollment has_many :resources has_many :prerequisites has_many :lessons # gets all associated enrollments given a collection of courses # all calls are called in parallel def self.enrollments_from_collection(courses, **conditions) enrollments = [] api.in_parallel do courses.reject { |course| AbsorbApi.configuration.ignored_course_ids.include? course.id }.each do |course| enrollments << api.get("courses/#{course.id}/enrollments", conditions) end end enrollments.map { |response| response.body.map { |attrs| CourseEnrollment.new(attrs) } }.flatten end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
absorb_api-0.1.6 | lib/absorb_api/course.rb |