Class: LearnSprout::Org

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Org

Returns a new instance of Org.



7
8
9
10
11
# File 'lib/learnsprout/org.rb', line 7

def initialize(attrs={})
  @client = attrs["client"]
  @org_id = attrs["id"]
  @name = attrs["name"]
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#org_idObject

Returns the value of attribute org_id.



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

def org_id
  @org_id
end

Instance Method Details

#course(course_id) ⇒ Object



57
58
59
# File 'lib/learnsprout/org.rb', line 57

def course(course_id)
  @client.course(@org_id, course_id)
end

#coursesObject



53
54
55
# File 'lib/learnsprout/org.rb', line 53

def courses
  @client.courses(@org_id)
end

#school(school_id) ⇒ Object



13
14
15
# File 'lib/learnsprout/org.rb', line 13

def school(school_id)
  @client.school(@org_id, school_id)
end

#schoolsObject



17
18
19
# File 'lib/learnsprout/org.rb', line 17

def schools
  @client.schools(@org_id)
end

#section(section_id) ⇒ Object



33
34
35
# File 'lib/learnsprout/org.rb', line 33

def section(section_id)
  @client.section(@org_id, section_id)
end

#sectionsObject



29
30
31
# File 'lib/learnsprout/org.rb', line 29

def sections
  @client.sections(@org_id)
end

#student(student_id) ⇒ Object



25
26
27
# File 'lib/learnsprout/org.rb', line 25

def student(student_id)
  @client.student(@org_id, student_id)
end

#studentsObject



21
22
23
# File 'lib/learnsprout/org.rb', line 21

def students
  @client.students(@org_id)
end

#teacher(teacher_id) ⇒ Object



41
42
43
# File 'lib/learnsprout/org.rb', line 41

def teacher(teacher_id)
  @client.teacher(@org_id, teacher_id)
end

#teachersObject



37
38
39
# File 'lib/learnsprout/org.rb', line 37

def teachers
  @client.teachers(@org_id)
end

#term(term_id) ⇒ Object



49
50
51
# File 'lib/learnsprout/org.rb', line 49

def term(term_id)
  @client.term(@org_id, term_id)
end

#termsObject



45
46
47
# File 'lib/learnsprout/org.rb', line 45

def terms
  @client.terms(@org_id)
end