class AgeCheq::Child
Attributes
pin[R]
Public Class Methods
associate(pin, data)
click to toggle source
# File lib/agecheq/child.rb, line 16 def associate(pin, data) self.new(pin).associate(data) end
check(pin)
click to toggle source
# File lib/agecheq/child.rb, line 12 def check(pin) self.new(pin).check end
configure!()
click to toggle source
# File lib/agecheq/child.rb, line 20 def configure! raise 'You must set the api_key and application_id using configure' unless AgeCheq.configuration.configured? basic_auth AgeCheq.configuration.api_key, ' ' base_uri 'https://api.agecheq.com/applications/' + AgeCheq.configuration.application_id end
new(pin)
click to toggle source
# File lib/agecheq/child.rb, line 29 def initialize(pin) @pin = pin self.class.configure! end
Public Instance Methods
associate(data)
click to toggle source
Associate some data with a child’s account.
# File lib/agecheq/child.rb, line 41 def associate(data) response = self.class.get("/acpin/#{@pin}/associate/#{data}") response.parsed_response end
check()
click to toggle source
Check the status of a child using their pin.
# File lib/agecheq/child.rb, line 35 def check response = self.class.get("/acpin/#{@pin}/check") response.parsed_response end