Class: Wonde::Client
- Inherits:
-
Object
- Object
- Wonde::Client
- Defined in:
- lib/client.rb
Overview
Main client class that the user will interface with
Constant Summary collapse
- @@version =
'0.0.6'
Instance Attribute Summary collapse
-
#attendanceCodes ⇒ Object
Returns the value of attribute attendanceCodes.
-
#schools ⇒ Object
Returns the value of attribute schools.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token) ⇒ Object
constructor
Initialize a Client Object.
-
#requestAccess(schoolId) ⇒ Object
requestAccess endpoint POST.
-
#revokeAccess(schoolId) ⇒ Object
revokeAccess endpoint DELETE.
-
#school(id) ⇒ Object
Get School/Schools Object.
Constructor Details
#initialize(token) ⇒ Object
Initialize a Client Object
28 29 30 31 32 33 |
# File 'lib/client.rb', line 28 def initialize(token) @@token = token @token = token @schools = Wonde::Schools.new(token) @attendanceCodes = Wonde::AttendanceCodes.new(token) end |
Instance Attribute Details
#attendanceCodes ⇒ Object
Returns the value of attribute attendanceCodes.
17 18 19 |
# File 'lib/client.rb', line 17 def attendanceCodes @attendanceCodes end |
#schools ⇒ Object
Returns the value of attribute schools.
17 18 19 |
# File 'lib/client.rb', line 17 def schools @schools end |
#token ⇒ Object
Returns the value of attribute token.
17 18 19 |
# File 'lib/client.rb', line 17 def token @token end |
Instance Method Details
#requestAccess(schoolId) ⇒ Object
requestAccess endpoint POST
55 56 57 |
# File 'lib/client.rb', line 55 def requestAccess(schoolId) return Wonde::Endpoints.new(@token, ('schools/' + schoolId + '/request-access')).post() end |
#revokeAccess(schoolId) ⇒ Object
revokeAccess endpoint DELETE
67 68 69 |
# File 'lib/client.rb', line 67 def revokeAccess(schoolId) return Wonde::Endpoints.new(@token, ('schools/' + schoolId + '/revoke-access')).delete() end |
#school(id) ⇒ Object
Get School/Schools Object
43 44 45 |
# File 'lib/client.rb', line 43 def school(id) return Wonde::Schools.new(@token, id) end |