Every repository with this icon (
Every repository with this icon (
Home
RTunesU is a ruby library for interacting with Apple’s iTunes U service in an object oriented manner. To use this library you will need access to your iTunes U site name, administrator credential string, and shared secret. This information should have been provided for you in an email from Apple welcoming you to iTunes U.
To work with iTunes U, you will first need to establish a connection to the webservice.
require 'rtunesu'
include RTunesU
user = RTunesU::User.new(0, 'admin', 'Admin', 'admin@example.com')
user.credentials = ['Administrator@urn:mace:example.edu']
connection = RTunesU::Connection.new(:user => user, :site => 'example.edu', :shared_secret => 'STRINGOFTHIRTYTWOLETTERSORDIGITS')
Once you have a connection you can use it to find any Entity in iTunes U if you know it’s type (e.g. ‘Course’, ‘Group’) and its Handle attribute.
course = Course.find(12345678, connection)
#=> <RTunesU::Course:0x355854 Handle=12345678 Name='Learning in iTunes'>
This Entity will have access to all of it’s attributes and sub-entities and parent entities. You can access attributes and sub-entities with its name as a method. You can access an objets parent entity with the .parent method.
Accessing attributes:
course.Handle
- 12345678
course.Name
- “Learning in iTunes”
course.Instructor
- “James E. Professor”
Accessing sub-entities
course.Groups
- [
, ]
course.Groups.first
- <RTunesU::Group:0×355854 Handle=9876543 Name=’Lectures’>
course.Groups.first.Name
- “Lectures”
Accessing an Entity’s parent
course.parent
course.parent.name
- “Learning Technologies”
For additional Information on using RTunesU see:







