Class: AbsorbApi::Course

Inherits:
Base
  • Object
show all
Includes:
Relations
Defined in:
lib/absorb_api/course.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from AbsorbApi::Base

Instance Attribute Details

#access_dateObject

Returns the value of attribute access_date.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def access_date
  @access_date
end

#active_statusObject

Returns the value of attribute active_status.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def active_status
  @active_status
end

#allow_course_evaluationObject

Returns the value of attribute allow_course_evaluation.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def allow_course_evaluation
  @allow_course_evaluation
end

#audienceObject

Returns the value of attribute audience.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def audience
  @audience
end

#category_idObject

Returns the value of attribute category_id.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def category_id
  @category_id
end

#certificate_urlObject

Returns the value of attribute certificate_url.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def certificate_url
  @certificate_url
end

#company_costObject

Returns the value of attribute company_cost.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def company_cost
  @company_cost
end

#company_timeObject

Returns the value of attribute company_time.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def company_time
  @company_time
end

#competency_definition_idsObject

Returns the value of attribute competency_definition_ids.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def competency_definition_ids
  @competency_definition_ids
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def description
  @description
end

#editor_idsObject

Returns the value of attribute editor_ids.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def editor_ids
  @editor_ids
end

#expire_durationObject

Returns the value of attribute expire_duration.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def expire_duration
  @expire_duration
end

#expire_typeObject

Returns the value of attribute expire_type.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def expire_type
  @expire_type
end

#expiry_dateObject

Returns the value of attribute expiry_date.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def expiry_date
  @expiry_date
end

#external_idObject

Returns the value of attribute external_id.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def external_id
  @external_id
end

#goalsObject

Returns the value of attribute goals.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def goals
  @goals
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def id
  @id
end

#learner_costObject

Returns the value of attribute learner_cost.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def learner_cost
  @learner_cost
end

#learner_timeObject

Returns the value of attribute learner_time.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def learner_time
  @learner_time
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def name
  @name
end

#notesObject

Returns the value of attribute notes.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def notes
  @notes
end

#post_enrollment_course_idsObject

Returns the value of attribute post_enrollment_course_ids.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def post_enrollment_course_ids
  @post_enrollment_course_ids
end

#prerequisite_course_idsObject

Returns the value of attribute prerequisite_course_ids.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def prerequisite_course_ids
  @prerequisite_course_ids
end

#pricesObject

Returns the value of attribute prices.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def prices
  @prices
end

#resource_idsObject

Returns the value of attribute resource_ids.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def resource_ids
  @resource_ids
end

#tag_idsObject

Returns the value of attribute tag_ids.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def tag_ids
  @tag_ids
end

#vendorObject

Returns the value of attribute vendor.



5
6
7
# File 'lib/absorb_api/course.rb', line 5

def vendor
  @vendor
end

Class Method Details

.enrollments_from_collection(courses, **conditions) ⇒ Object

gets all associated enrollments given a collection of courses all calls are called in parallel



16
17
18
19
20
21
22
23
24
# File 'lib/absorb_api/course.rb', line 16

def self.enrollments_from_collection(courses, **conditions)
  enrollments = []
  AbsorbApi.api.in_parallel do
    courses.reject { |course| AbsorbApi.configuration.ignored_course_ids.include? course.id }.each do |course|
      enrollments << AbsorbApi.api.get("courses/#{course.id}/enrollments", conditions)
    end
  end
  enrollments.map { |response| response.body.map { |attrs| CourseEnrollment.new(attrs) } }.flatten
end