Class: LearnSprout::School

Inherits:
Object
  • Object
show all
Defined in:
lib/learnsprout/school.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#addressObject

Returns the value of attribute address.



4
5
6
# File 'lib/learnsprout/school.rb', line 4

def address
  @address
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/learnsprout/school.rb', line 4

def name
  @name
end

#ncesObject

Returns the value of attribute nces.



4
5
6
# File 'lib/learnsprout/school.rb', line 4

def nces
  @nces
end

#numberObject

Returns the value of attribute number.



4
5
6
# File 'lib/learnsprout/school.rb', line 4

def number
  @number
end

#phoneObject

Returns the value of attribute phone.



4
5
6
# File 'lib/learnsprout/school.rb', line 4

def phone
  @phone
end

#school_idObject

Returns the value of attribute school_id.



4
5
6
# File 'lib/learnsprout/school.rb', line 4

def school_id
  @school_id
end

#time_updatedObject

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

#coursesObject



66
67
68
# File 'lib/learnsprout/school.rb', line 66

def courses
  @client.courses(@org_id, :school_id => @school_id)
end

#current_termObject



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

#sectionsObject



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

#studentsObject



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

#teachersObject



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

#termsObject



54
55
56
# File 'lib/learnsprout/school.rb', line 54

def terms
  @client.terms(@org_id, :school_id => @school_id)
end