Class: TIES::Teachers

Inherits:
Base
  • Object
show all
Defined in:
lib/ties/teachers.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#api_key, #district_number, #endpoint, #secret_key

Instance Method Summary collapse

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_countObject

Returns the value of attribute total_count.



2
3
4
# File 'lib/ties/teachers.rb', line 2

def total_count
  @total_count
end

#total_pagesObject

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, options = {})
  result = @ties.send_request('Staff/Teachers/%i' % page, options)
  return [] unless result
  self.total_pages = result['TotalPages']
  self.total_count = result['TotalCount']
  return result['Return']
end