Class: TIES::Teachers
Instance Attribute Summary collapse
-
#total_count ⇒ Object
Returns the value of attribute total_count.
-
#total_pages ⇒ Object
Returns the value of attribute total_pages.
Attributes inherited from Base
#api_key, #district_number, #endpoint, #secret_key
Instance Method Summary collapse
- #get(page = 1, options = {}) ⇒ Object
-
#initialize(ties) ⇒ Teachers
constructor
A new instance of Teachers.
Methods inherited from Base
#all, #authentication, #classes, #each, #reimbursements, #requested_classes, #schools, #send_request, #students, #teachers
Constructor Details
#initialize(ties) ⇒ Teachers
Returns a new instance of Teachers.
3 4 5 |
# File 'lib/ties/teachers.rb', line 3 def initialize(ties) @ties = ties end |
Instance Attribute Details
#total_count ⇒ Object
Returns the value of attribute total_count.
2 3 4 |
# File 'lib/ties/teachers.rb', line 2 def total_count @total_count end |
#total_pages ⇒ Object
Returns the value of attribute total_pages.
2 3 4 |
# File 'lib/ties/teachers.rb', line 2 def total_pages @total_pages end |
Instance Method Details
#get(page = 1, options = {}) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/ties/teachers.rb', line 6 def get(page = 1, = {}) result = @ties.send_request('Staff/Teachers/%i' % page, ) return [] unless result self.total_pages = result['TotalPages'] self.total_count = result['TotalCount'] return result['Return'] end |