Module: CleverSDK::Client::Sections
- Included in:
- CleverSDK::Client
- Defined in:
- lib/clever_sdk/client/sections.rb
Instance Method Summary collapse
- #section(id) ⇒ Object
- #section_course(id) ⇒ Object
- #section_district(id) ⇒ Object
- #section_resources(id, limit: nil, starting_after: nil, ending_before: nil) ⇒ Object
- #section_school(id) ⇒ Object
- #section_term(id) ⇒ Object
-
#section_users(id, role: nil, limit: nil, starting_after: nil, ending_before: nil) ⇒ Object
role - acceptable values are nil, :student, :teacher.
-
#sections(limit: nil, starting_after: nil, ending_before: nil, count: nil) ⇒ Object
count - acceptable values are nil, :true, :false, :undefined.
Instance Method Details
#section(id) ⇒ Object
15 16 17 18 19 |
# File 'lib/clever_sdk/client/sections.rb', line 15 def section(id) response = api.section(access_token: access_token, id: id) data = response.body.dig("data") CleverSDK::Data::Section.new(data, response) end |
#section_course(id) ⇒ Object
21 22 23 24 25 |
# File 'lib/clever_sdk/client/sections.rb', line 21 def section_course(id) response = api.section_course(access_token: access_token, id: id) data = response.body.dig("data") CleverSDK::Data::Course.new(data, response) end |
#section_district(id) ⇒ Object
27 28 29 30 31 |
# File 'lib/clever_sdk/client/sections.rb', line 27 def section_district(id) response = api.section_district(access_token: access_token, id: id) data = response.body.dig("data") CleverSDK::Data::District.new(data, response) end |
#section_resources(id, limit: nil, starting_after: nil, ending_before: nil) ⇒ Object
33 34 35 36 37 |
# File 'lib/clever_sdk/client/sections.rb', line 33 def section_resources(id, limit: nil, starting_after: nil, ending_before: nil) response = api.section_resources(access_token: access_token, id: id, limit: limit, starting_after: starting_after, ending_before: ending_before) CleverSDK::Data::Resources.new(response) end |
#section_school(id) ⇒ Object
39 40 41 42 43 |
# File 'lib/clever_sdk/client/sections.rb', line 39 def section_school(id) response = api.section_district(access_token: access_token, id: id) data = response.body.dig("data") CleverSDK::Data::School.new(data, response) end |
#section_term(id) ⇒ Object
45 46 47 48 49 |
# File 'lib/clever_sdk/client/sections.rb', line 45 def section_term(id) response = api.section_district(access_token: access_token, id: id) data = response.body.dig("data") CleverSDK::Data::Term.new(data, response) end |
#section_users(id, role: nil, limit: nil, starting_after: nil, ending_before: nil) ⇒ Object
role - acceptable values are nil, :student, :teacher
52 53 54 55 56 |
# File 'lib/clever_sdk/client/sections.rb', line 52 def section_users(id, role: nil, limit: nil, starting_after: nil, ending_before: nil) response = api.section_users(access_token: access_token, id: id, role: role, limit: limit, starting_after: starting_after, ending_before: ending_before) CleverSDK::Data::Users.new(response) end |
#sections(limit: nil, starting_after: nil, ending_before: nil, count: nil) ⇒ Object
count - acceptable values are nil, :true, :false, :undefined
9 10 11 12 13 |
# File 'lib/clever_sdk/client/sections.rb', line 9 def sections(limit: nil, starting_after: nil, ending_before: nil, count: nil) response = api.sections(access_token: access_token, limit: limit, starting_after: starting_after, ending_before: ending_before, count: count) CleverSDK::Data::Sections.new(response) end |