class Wonde::Client
Main client class that the user will interface with
@param token [String] @return [Object]
@example
require 'wondeclient' client = Wonde::Client.new('TOKEN_GOES_HERE') client.schools.all().each do |school| p school.name end
Attributes
attendanceCodes[RW]
schools[RW]
token[RW]
Public Class Methods
new(token)
click to toggle source
Initialize a Client
Object
@param token [String] @return [Object]
@example
Wonde::Client.new("SOMETOKEN") #=> #<Wonde::Client:0x007fb223953da0 @token="SOMETOKEN">
# File lib/client.rb, line 28 def initialize(token) @@token = token @token = token @schools = Wonde::Schools.new(token) @attendanceCodes = Wonde::AttendanceCodes.new(token) end
Public Instance Methods
requestAccess(schoolId)
click to toggle source
requestAccess endpoint POST
@param schoolId [String] @return [Object]
@example
client = Wonde::Client.new("SOMETOKEN") client.requestAccess("A0000000000")
# File lib/client.rb, line 55 def requestAccess(schoolId) return Wonde::Endpoints.new(@token, ('schools/' + schoolId + '/request-access')).post() end
revokeAccess(schoolId)
click to toggle source
revokeAccess endpoint DELETE
@param schoolId [String] @return [Object]
@example
client = Wonde::Client.new("SOMETOKEN") client.revokeAccess('A0000000000')
# File lib/client.rb, line 67 def revokeAccess(schoolId) return Wonde::Endpoints.new(@token, ('schools/' + schoolId + '/revoke-access')).delete() end
school(id)
click to toggle source
Get School/Schools Object
@param id [String] @return [Object]
@example
client = Wonde::Client.new("SOMETOKEN") school = client.school('SCHOOLID')
# File lib/client.rb, line 43 def school(id) return Wonde::Schools.new(@token, id) end