Install the gem by issuing
gem install school_loopor put it in your Gemfile and run bundle install
gem "school_loop"These global settings will be used unless specifically overridden by an instance below.
SchoolLoop.configure do |config|
config.subdomain = 'demoschool'
config.username = 'apiuser'
config.password = 'some_api_password'
config.adapter = :net_http
endCreate a new client using the global defaults:
school_loop = SchoolLoop.newCreate a new client instance and override global defaults
school_loop = SchoolLoop.new subdomain: 'demoschool', username: 'apiuser', password: 'some_api_password'Alternatively, you can configure the School Loop settings by passing a block:
school_loop = SchoolLoop.new do |config|
config.subdomain = 'demoschool'
config.username = 'apiuser'
config.password = 'some_api_password'
config.adapter = :net_http
endCurrently, only three methods are implemented:
roster = school_loop.get_roster
# returns a Nokogiri::XML::Documentteacher_id = "12345"
roster = school_loop.get_roster(teacher_id)
# returns a Nokogiri::XML::Document (with a single 'teacher' node)Example roster data is available on School Loop's Documentation
For a detailed schema for Progress reports, you can look at School Loop's Progress Report API Schema
prog_report_xml = <<-EOF
<?xml version="1.0" encoding="UTF-8"?>
<root>
<sections>
<section ID="1234">
<progressReports>
<progressReport markName="Current Grades" ... grade="A">
...
</progressReport>
</progressReports>
</section>
</sections>
</root>
EOF
school_loop.publish_progress_report(prog_report_xml)This gem is heavily based on the bitbucket_rest_api gem by Mike Cochran.