Class: LearnSprout::School
- Inherits:
-
Object
- Object
- LearnSprout::School
- Defined in:
- lib/learnsprout/school.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#name ⇒ Object
Returns the value of attribute name.
-
#nces ⇒ Object
Returns the value of attribute nces.
-
#number ⇒ Object
Returns the value of attribute number.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#school_id ⇒ Object
Returns the value of attribute school_id.
-
#time_updated ⇒ Object
Returns the value of attribute time_updated.
Instance Method Summary collapse
- #course(course_id) ⇒ Object
- #courses ⇒ Object
- #current_term ⇒ Object
-
#initialize(attrs = {}) ⇒ School
constructor
A new instance of School.
- #section(section_id) ⇒ Object
- #sections ⇒ Object
-
#student(student_id) ⇒ Object
TODO Add org method?.
- #students ⇒ Object
- #teacher(teacher_id) ⇒ Object
- #teachers ⇒ Object
- #term(term_id) ⇒ Object
- #terms ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ School
Returns a new instance of School.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/learnsprout/school.rb', line 12 def initialize(attrs={}) @client = attrs["client"] @org_id = attrs["org_id"] @school_id = attrs["id"] @name = attrs["name"] @number = attrs["number"] @nces = Nces.new(attrs["nces"]) @phone = Phone.new(attrs["phone"]) @address = Address.new(attrs["address"]) @time_updated = attrs["time_updated"] end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
4 5 6 |
# File 'lib/learnsprout/school.rb', line 4 def address @address end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/learnsprout/school.rb', line 4 def name @name end |
#nces ⇒ Object
Returns the value of attribute nces.
4 5 6 |
# File 'lib/learnsprout/school.rb', line 4 def nces @nces end |
#number ⇒ Object
Returns the value of attribute number.
4 5 6 |
# File 'lib/learnsprout/school.rb', line 4 def number @number end |
#phone ⇒ Object
Returns the value of attribute phone.
4 5 6 |
# File 'lib/learnsprout/school.rb', line 4 def phone @phone end |
#school_id ⇒ Object
Returns the value of attribute school_id.
4 5 6 |
# File 'lib/learnsprout/school.rb', line 4 def school_id @school_id end |
#time_updated ⇒ Object
Returns the value of attribute time_updated.
4 5 6 |
# File 'lib/learnsprout/school.rb', line 4 def time_updated @time_updated end |
Instance Method Details
#course(course_id) ⇒ Object
62 63 64 |
# File 'lib/learnsprout/school.rb', line 62 def course(course_id) @client.course(@org_id, course_id) end |
#courses ⇒ Object
66 67 68 |
# File 'lib/learnsprout/school.rb', line 66 def courses @client.courses(@org_id, :school_id => @school_id) end |
#current_term ⇒ Object
58 59 60 |
# File 'lib/learnsprout/school.rb', line 58 def current_term @client.current_term(@org_id, @school_id) end |
#section(section_id) ⇒ Object
34 35 36 |
# File 'lib/learnsprout/school.rb', line 34 def section(section_id) @client.section(@org_id, section_id) end |
#sections ⇒ Object
38 39 40 |
# File 'lib/learnsprout/school.rb', line 38 def sections @client.sections(@org_id, :school_id => @school_id) end |
#student(student_id) ⇒ Object
TODO Add org method?
26 27 28 |
# File 'lib/learnsprout/school.rb', line 26 def student(student_id) @client.student(@org_id, student_id) end |
#students ⇒ Object
30 31 32 |
# File 'lib/learnsprout/school.rb', line 30 def students @client.students(@org_id, :school_id => @school_id) end |
#teacher(teacher_id) ⇒ Object
42 43 44 |
# File 'lib/learnsprout/school.rb', line 42 def teacher(teacher_id) @client.teacher(@org_id, teacher_id) end |
#teachers ⇒ Object
46 47 48 |
# File 'lib/learnsprout/school.rb', line 46 def teachers @client.teachers(@org_id, :school_id => @school_id) end |
#term(term_id) ⇒ Object
50 51 52 |
# File 'lib/learnsprout/school.rb', line 50 def term(term_id) @client.term(@org_id, term_id) end |
#terms ⇒ Object
54 55 56 |
# File 'lib/learnsprout/school.rb', line 54 def terms @client.terms(@org_id, :school_id => @school_id) end |