Module: Moodle::Service::Cohort

Included in:
Client
Defined in:
lib/moodle/services/cohort.rb

Instance Method Summary collapse

Instance Method Details

#core_cohort_get_cohorts(ids) ⇒ Object

Returns cohort details


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/moodle/services/cohort.rb', line 5

def core_cohort_get_cohorts(ids)
  params = {}

  counter = 0
  ids.each do |id|
    params['cohortids[' + counter.to_s + ']'] = id
    counter = counter + 1
  end

  response = request(params)

  if response.any?
    cohorts = response.map { |cohort| Hashie::Mash.new(cohort) }
  end
end