learnsprout 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,25 +5,25 @@ Feature: Get Courses
5
5
  Scenario: List courses by org id
6
6
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
7
7
  * When I request courses for an organization with id 4fdaeaa92eea44952ab9e520
8
- * I should get a list of 23 courses
8
+ * I should get a page of 23 items
9
9
 
10
10
  Scenario: List courses by org
11
11
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
12
12
  * I request an org with id 4fdaeaa92eea44952ab9e520
13
13
  * When I request courses for that org
14
- * I should get a list of 23 courses
14
+ * I should get a page of 23 items
15
15
 
16
16
  Scenario: List courses by org id and school id
17
17
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
18
18
  * When I request courses for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86faa411b22c9a3fd2f
19
- * I should get a list of 18 courses
19
+ * I should get a page of 18 items
20
20
 
21
21
  Scenario: List courses by school
22
22
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
23
23
  * I request an org with id 4fdaeaa92eea44952ab9e520
24
24
  * I request a school with id 4fdac86faa411b22c9a3fd2f for that org
25
25
  * When I request courses for that school
26
- * I should get a list of 18 courses
26
+ * I should get a page of 18 items
27
27
 
28
28
  Scenario: Course by school and course id
29
29
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
@@ -5,7 +5,7 @@ Feature: Get Orgs
5
5
  Scenario: List all orgs
6
6
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
7
7
  * When I request orgs
8
- * I should get the organization with id 4fdaeaa92eea44952ab9e520
8
+ * I should get a list of 2 orgs
9
9
 
10
10
  Scenario: Org by ID
11
11
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
@@ -5,13 +5,13 @@ Feature: Get Schools
5
5
  Scenario: List schools by org id
6
6
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
7
7
  * When I request schools for an organization with id 4fdaeaa92eea44952ab9e520
8
- * I should get a list of 7 schools
8
+ * I should get a page of 7 items
9
9
 
10
10
  Scenario: List schools by org
11
11
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
12
12
  * I request an org with id 4fdaeaa92eea44952ab9e520
13
13
  * When I request schools for that org
14
- * I should get a list of 7 schools
14
+ * I should get a page of 7 items
15
15
 
16
16
  Scenario: School by org id and school id
17
17
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
@@ -5,25 +5,31 @@ Feature: Get Sections
5
5
  Scenario: List sections by org id
6
6
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
7
7
  * When I request sections for an organization with id 4fdaeaa92eea44952ab9e520
8
- * I should get a list of 50 sections
8
+ * I should get a page of 50 items
9
9
 
10
10
  Scenario: List sections by org
11
11
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
12
12
  * I request an org with id 4fdaeaa92eea44952ab9e520
13
13
  * When I request sections for that org
14
- * I should get a list of 50 sections
14
+ * I should get a page of 50 items
15
15
 
16
16
  Scenario: List sections by org id and school id
17
17
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
18
18
  * When I request sections for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86eaa411b22c9a3fd2e
19
- * I should get a list of 50 sections
19
+ * I should get a page of 50 items
20
20
 
21
21
  Scenario: List sections by school
22
22
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
23
23
  * I request an org with id 4fdaeaa92eea44952ab9e520
24
24
  * I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
25
25
  * When I request sections for that school
26
- * I should get a list of 50 sections
26
+ * I should get a page of 50 items
27
+
28
+ Scenario: List next page of sections
29
+ * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
30
+ * I request sections for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86eaa411b22c9a3fd2e
31
+ * When I request the next page
32
+ * I should get a page of 30 items
27
33
 
28
34
  Scenario: Section by school and section id
29
35
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
@@ -10,6 +10,16 @@ end
10
10
  After do
11
11
  end
12
12
 
13
+ # Miscellaneous
14
+
15
+ Given /^I should get a page of (\d+) items$/ do |count|
16
+ @page.items.count.should == Integer(count)
17
+ end
18
+
19
+ Given /^(?:When )?I request the next page$/ do
20
+ @page = @page.next
21
+ end
22
+
13
23
  # Client
14
24
 
15
25
  Given /^I have entered my api key as ([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})$/ do |api_key|
@@ -20,6 +30,10 @@ Given /^(?:When )?I request orgs$/ do
20
30
  @orgs = @client.orgs
21
31
  end
22
32
 
33
+ Given /^I should get a list of (\d+) orgs$/ do |count|
34
+ @orgs.count.should == Integer(count)
35
+ end
36
+
23
37
  Given /^I should get the organization with id ([a-f0-9]{24})$/ do |org_id|
24
38
  org = @orgs.first
25
39
  org.org_id.should == org_id
@@ -36,11 +50,7 @@ end
36
50
  # Schools
37
51
 
38
52
  Given /^(?:When )?I request schools for an organization with id ([a-f0-9]{24})$/ do |org_id|
39
- @schools = @client.schools(org_id)
40
- end
41
-
42
- Given /^I should get a list of (\d+) schools$/ do |count|
43
- @schools.count.should == Integer(count)
53
+ @page = @client.schools(org_id)
44
54
  end
45
55
 
46
56
  Given /^(?:When )?I request a school with id ([a-f0-9]{24}) for that org$/ do |school_id|
@@ -52,7 +62,7 @@ Given /^I should get a school with id ([a-f0-9]{24})$/ do |school_id|
52
62
  end
53
63
 
54
64
  Given /^(?:When )?I request schools for that org$/ do
55
- @schools = @org.schools
65
+ @page = @org.schools
56
66
  end
57
67
 
58
68
  Given /^(?:When )?I request a school with id ([a-f0-9]{24}) for an org with id ([a-f0-9]{24})$/ do |school_id, org_id|
@@ -62,7 +72,7 @@ end
62
72
  # Students
63
73
 
64
74
  Given /^(?:When )?I request students for an organization with id ([a-f0-9]{24})$/ do |org_id|
65
- @students = @client.students(org_id)
75
+ @page = @client.students(org_id)
66
76
  end
67
77
 
68
78
  Given /^I should get a list of (\d+) students$/ do |count|
@@ -70,7 +80,7 @@ Given /^I should get a list of (\d+) students$/ do |count|
70
80
  end
71
81
 
72
82
  Given /^(?:When )?I request students for that org$/ do
73
- @students = @org.students
83
+ @page = @org.students
74
84
  end
75
85
 
76
86
  Given /^I should get a student with id ([a-f0-9]{24})$/ do |student_id|
@@ -90,17 +100,17 @@ Given /^(?:When )?I request a student with id ([a-f0-9]{24}) for that org$/ do |
90
100
  end
91
101
 
92
102
  Given /^(?:When )?I request students for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
93
- @students = @client.students(org_id, school_id)
103
+ @page = @client.students(org_id, school_id)
94
104
  end
95
105
 
96
106
  Given /^(?:When )?I request students for that school$/ do
97
- @students = @school.students
107
+ @page = @school.students
98
108
  end
99
109
 
100
110
  # Sections
101
111
 
102
112
  Given /^When I request sections for an organization with id ([a-f0-9]{24})$/ do |org_id|
103
- @sections = @client.sections(org_id)
113
+ @page = @client.sections(org_id)
104
114
  end
105
115
 
106
116
  Given /^I should get a list of (\d+) sections$/ do |count|
@@ -108,15 +118,15 @@ Given /^I should get a list of (\d+) sections$/ do |count|
108
118
  end
109
119
 
110
120
  Given /^(?:When )?I request sections for that org$/ do
111
- @sections = @org.sections
121
+ @page = @org.sections
112
122
  end
113
123
 
114
124
  Given /^(?:When )?I request sections for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
115
- @sections = @client.sections(org_id, :school_id => school_id)
125
+ @page = @client.sections(org_id, :school_id => school_id)
116
126
  end
117
127
 
118
128
  Given /^(?:When )?I request sections for that school$/ do
119
- @sections = @school.sections
129
+ @page = @school.sections
120
130
  end
121
131
 
122
132
  Given /^(?:When )?I request a section with id ([a-f0-9]{24}) for that school$/ do |section_id|
@@ -158,23 +168,19 @@ end
158
168
  # Teachers
159
169
 
160
170
  Given /^When I request teachers for an organization with id ([a-f0-9]{24})$/ do |org_id|
161
- @teachers = @client.teachers(org_id)
162
- end
163
-
164
- Given /^I should get a list of (\d+) teachers$/ do |count|
165
- @teachers.count.should == Integer(count)
171
+ @page = @client.teachers(org_id)
166
172
  end
167
173
 
168
174
  Given /^(?:When )?I request teachers for that org$/ do
169
- @teachers = @org.teachers
175
+ @page = @org.teachers
170
176
  end
171
177
 
172
178
  Given /^(?:When )?I request teachers for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
173
- @teachers = @client.teachers(org_id, :school_id => school_id)
179
+ @page = @client.teachers(org_id, :school_id => school_id)
174
180
  end
175
181
 
176
182
  Given /^(?:When )?I request teachers for that school$/ do
177
- @teachers = @school.teachers
183
+ @page = @school.teachers
178
184
  end
179
185
 
180
186
  Given /^(?:When )?I request a teacher with id ([a-f0-9]{24}) for that school$/ do |teacher_id|
@@ -200,23 +206,19 @@ end
200
206
  # Terms
201
207
 
202
208
  Given /^When I request terms for an organization with id ([a-f0-9]{24})$/ do |org_id|
203
- @terms = @client.terms(org_id)
204
- end
205
-
206
- Given /^I should get a list of (\d+) terms$/ do |count|
207
- @terms.count.should == Integer(count)
209
+ @page = @client.terms(org_id)
208
210
  end
209
211
 
210
212
  Given /^(?:When )?I request terms for that org$/ do
211
- @terms = @org.terms
213
+ @page = @org.terms
212
214
  end
213
215
 
214
216
  Given /^(?:When )?I request terms for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
215
- @terms = @client.terms(org_id, :school_id => school_id)
217
+ @page = @client.terms(org_id, :school_id => school_id)
216
218
  end
217
219
 
218
220
  Given /^(?:When )?I request terms for that school$/ do
219
- @terms = @school.terms
221
+ @page = @school.terms
220
222
  end
221
223
 
222
224
  Given /^(?:When )?I request a term with id ([a-f0-9]{24}) for that school$/ do |term_id|
@@ -255,23 +257,19 @@ end
255
257
  # Courses
256
258
 
257
259
  Given /^When I request courses for an organization with id ([a-f0-9]{24})$/ do |org_id|
258
- @courses = @client.courses(org_id)
259
- end
260
-
261
- Given /^I should get a list of (\d+) courses$/ do |count|
262
- @courses.count.should == Integer(count)
260
+ @page = @client.courses(org_id)
263
261
  end
264
262
 
265
263
  Given /^(?:When )?I request courses for that org$/ do
266
- @courses = @org.courses
264
+ @page = @org.courses
267
265
  end
268
266
 
269
267
  Given /^(?:When )?I request courses for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
270
- @courses = @client.courses(org_id, :school_id => school_id)
268
+ @page = @client.courses(org_id, :school_id => school_id)
271
269
  end
272
270
 
273
271
  Given /^(?:When )?I request courses for that school$/ do
274
- @courses = @school.courses
272
+ @page = @school.courses
275
273
  end
276
274
 
277
275
  Given /^(?:When )?I request a course with id ([a-f0-9]{24}) for that school$/ do |course_id|
@@ -5,25 +5,25 @@ Feature: Get Students
5
5
  Scenario: List students by org id
6
6
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
7
7
  * When I request students for an organization with id 4fdaeaa92eea44952ab9e520
8
- * I should get a list of 50 students
8
+ * I should get a page of 50 items
9
9
 
10
10
  Scenario: List students by org
11
11
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
12
12
  * I request an org with id 4fdaeaa92eea44952ab9e520
13
13
  * When I request students for that org
14
- * I should get a list of 50 students
14
+ * I should get a page of 50 items
15
15
 
16
16
  Scenario: List students by org id and school id
17
17
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
18
18
  * When I request students for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86eaa411b22c9a3fd2e
19
- * I should get a list of 50 students
19
+ * I should get a page of 50 items
20
20
 
21
21
  Scenario: List students by school
22
22
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
23
23
  * I request an org with id 4fdaeaa92eea44952ab9e520
24
24
  * I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
25
25
  * When I request students for that school
26
- * I should get a list of 50 students
26
+ * I should get a page of 50 items
27
27
 
28
28
  Scenario: Student by org id and student id
29
29
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
@@ -5,25 +5,25 @@ Feature: Get Teachers
5
5
  Scenario: List teachers by org id
6
6
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
7
7
  * When I request teachers for an organization with id 4fdaeaa92eea44952ab9e520
8
- * I should get a list of 50 teachers
8
+ * I should get a page of 50 items
9
9
 
10
10
  Scenario: List teachers by org
11
11
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
12
12
  * I request an org with id 4fdaeaa92eea44952ab9e520
13
13
  * When I request teachers for that org
14
- * I should get a list of 50 teachers
14
+ * I should get a page of 50 items
15
15
 
16
16
  Scenario: List teachers by org id and school id
17
17
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
18
18
  * When I request teachers for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86eaa411b22c9a3fd2e
19
- * I should get a list of 28 teachers
19
+ * I should get a page of 28 items
20
20
 
21
21
  Scenario: List teachers by school
22
22
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
23
23
  * I request an org with id 4fdaeaa92eea44952ab9e520
24
24
  * I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
25
25
  * When I request teachers for that school
26
- * I should get a list of 28 teachers
26
+ * I should get a page of 28 items
27
27
 
28
28
  Scenario: Teacher by school and teacher id
29
29
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
@@ -5,25 +5,25 @@ Feature: Get Terms
5
5
  Scenario: List terms by org id
6
6
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
7
7
  * When I request terms for an organization with id 4fdaeaa92eea44952ab9e520
8
- * I should get a list of 20 terms
8
+ * I should get a page of 20 items
9
9
 
10
10
  Scenario: List terms by org
11
11
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
12
12
  * I request an org with id 4fdaeaa92eea44952ab9e520
13
13
  * When I request terms for that org
14
- * I should get a list of 20 terms
14
+ * I should get a page of 20 items
15
15
 
16
16
  Scenario: List terms by org id and school id
17
17
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
18
18
  * When I request terms for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86eaa411b22c9a3fd2e
19
- * I should get a list of 1 terms
19
+ * I should get a page of 1 items
20
20
 
21
21
  Scenario: List terms by school
22
22
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
23
23
  * I request an org with id 4fdaeaa92eea44952ab9e520
24
24
  * I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
25
25
  * When I request terms for that school
26
- * I should get a list of 1 terms
26
+ * I should get a page of 1 items
27
27
 
28
28
  Scenario: Term by school and term id
29
29
  * I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
@@ -45,4 +45,5 @@ require "learnsprout/course"
45
45
  require "learnsprout/nces"
46
46
  require "learnsprout/phone"
47
47
  require "learnsprout/address"
48
+ require "learnsprout/page"
48
49
  require "learnsprout/version"
@@ -26,7 +26,7 @@ module LearnSprout
26
26
 
27
27
  def schools(org_id)
28
28
  schools = get("org/#{org_id}/school?apikey=#{@api_key}")
29
- instances_from_schools(org_id, schools)
29
+ Page.new("org/#{org_id}/school?apikey=#{@api_key}", School, :client => self, :org_id => org_id)
30
30
  end
31
31
 
32
32
  def student(org_id, student_id)
@@ -39,11 +39,11 @@ module LearnSprout
39
39
  def students(org_id, options = {})
40
40
  school_id = options[:school_id]
41
41
  if (school_id)
42
- students = get("org/#{org_id}/school/#{school_id}/student?apikey=#{@api_key}")
42
+ url = "org/#{org_id}/school/#{school_id}/student?apikey=#{@api_key}"
43
43
  else
44
- students = get("org/#{org_id}/student?apikey=#{@api_key}")
44
+ url = "org/#{org_id}/student?apikey=#{@api_key}"
45
45
  end
46
- instances_from_students(org_id, students)
46
+ Page.new(url, Student, :org_id => org_id, :client => self)
47
47
  end
48
48
 
49
49
  def section(org_id, section_id)
@@ -61,8 +61,7 @@ module LearnSprout
61
61
  else
62
62
  url = "org/#{org_id}/section?apikey=#{@api_key}"
63
63
  end
64
- sections = get(url)
65
- instances_from_sections(org_id, sections)
64
+ Page.new(url, Section, :org_id => org_id, :client => self)
66
65
  end
67
66
 
68
67
  def teacher(org_id, teacher_id)
@@ -80,8 +79,7 @@ module LearnSprout
80
79
  else
81
80
  url = "org/#{org_id}/teacher?apikey=#{@api_key}"
82
81
  end
83
- teachers = get(url)
84
- instances_from_teachers(org_id, teachers)
82
+ Page.new(url, Teacher, :org_id => org_id, :client => self)
85
83
  end
86
84
 
87
85
  def term(org_id, term_id)
@@ -99,8 +97,7 @@ module LearnSprout
99
97
  else
100
98
  url = "org/#{org_id}/term?apikey=#{@api_key}"
101
99
  end
102
- terms = get(url)
103
- instances_from_terms(org_id, terms)
100
+ Page.new(url, Term, :org_id => org_id, :client => self)
104
101
  end
105
102
 
106
103
  def current_term(org_id, school_id)
@@ -126,8 +123,7 @@ module LearnSprout
126
123
  else
127
124
  url = "org/#{org_id}/course?apikey=#{@api_key}"
128
125
  end
129
- courses = get(url)
130
- instances_from_courses(org_id, courses)
126
+ Page.new(url, Course, :org_id => org_id, :client => self)
131
127
  end
132
128
 
133
129
  private
@@ -139,71 +135,5 @@ module LearnSprout
139
135
  end
140
136
  return org_instances
141
137
  end
142
-
143
- def instances_from_schools(org_id, schools)
144
- school_instances = []
145
- #TODO Next
146
- schools["data"].each do |school|
147
- school["client"] = self
148
- school["org_id"] = org_id
149
- school_instances << School.new(school)
150
- end
151
- return school_instances
152
- end
153
-
154
- def instances_from_students(org_id, students)
155
- student_instances = []
156
- #TODO Next
157
- students["data"].each do |student|
158
- student["client"] = self
159
- student["org_id"] = org_id
160
- student_instances << Student.new(student)
161
- end
162
- return student_instances
163
- end
164
-
165
- def instances_from_sections(org_id, sections)
166
- section_instances = []
167
- #TODO Next
168
- sections["data"].each do |section|
169
- section["client"] = self
170
- section["org_id"] = org_id
171
- section_instances << Section.new(section)
172
- end
173
- return section_instances
174
- end
175
-
176
- def instances_from_teachers(org_id, teachers)
177
- teacher_instances = []
178
- #TODO Next
179
- teachers["data"].each do |teacher|
180
- teacher["client"] = self
181
- teacher["org_id"] = org_id
182
- teacher_instances << Teacher.new(teacher)
183
- end
184
- return teacher_instances
185
- end
186
-
187
- def instances_from_terms(org_id, terms)
188
- term_instances = []
189
- #TODO Next
190
- terms["data"].each do |term|
191
- term["client"] = self
192
- term["org_id"] = org_id
193
- term_instances << Term.new(term)
194
- end
195
- return term_instances
196
- end
197
-
198
- def instances_from_courses(org_id, courses)
199
- course_instances = []
200
- #TODO Next
201
- courses["data"].each do |course|
202
- course["client"] = self
203
- course["org_id"] = org_id
204
- course_instances << Course.new(course)
205
- end
206
- return course_instances
207
- end
208
138
  end
209
139
  end
@@ -0,0 +1,33 @@
1
+ module LearnSprout
2
+ class Page
3
+ include LearnSprout::Connection
4
+
5
+ attr_accessor :items
6
+
7
+ def initialize(url, type, extras = {})
8
+ @items = []
9
+ @type = type
10
+ @extras = extras
11
+ data = get(url)
12
+
13
+ @nextUrl = data["next"].to_s
14
+ # Remove base URL if it's included
15
+ prefix = LearnSprout.endpoint.to_s
16
+ if @nextUrl[0, prefix.length] == prefix
17
+ @nextUrl = @nextUrl[prefix.length, @nextUrl.length - prefix.length]
18
+ end
19
+
20
+ #TODO handle non-page URL?
21
+ data["data"].each do |item|
22
+ extras.each do |key, value|
23
+ item[key] = value
24
+ end
25
+ @items << type.new(item)
26
+ end
27
+ end
28
+
29
+ def next
30
+ return Page.new(@nextUrl, @type, @extras)
31
+ end
32
+ end
33
+ end
@@ -25,6 +25,10 @@ module LearnSprout
25
25
  end
26
26
  end
27
27
 
28
+ # Gets the sections for this term. This method is extremely slow as it retrieves a list of IDs
29
+ # for associated terms then performs a separate request for each term for each ID.
30
+ #
31
+ # TODO Optimize somehow, perhaps by lazy loading
28
32
  def sections
29
33
  temp_sections = []
30
34
  if @section_ids.count > 0
@@ -1,4 +1,4 @@
1
1
  module LearnSprout
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
4
4
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Francis Kam
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-07-22 00:00:00 -07:00
17
+ date: 2012-07-24 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -146,6 +146,7 @@ files:
146
146
  - lib/learnsprout/exceptions.rb
147
147
  - lib/learnsprout/nces.rb
148
148
  - lib/learnsprout/org.rb
149
+ - lib/learnsprout/page.rb
149
150
  - lib/learnsprout/phone.rb
150
151
  - lib/learnsprout/response/follow_redirects.rb
151
152
  - lib/learnsprout/response/parse_json.rb