Class: Kickboxer::Person

Inherits:
Object
  • Object
show all
Defined in:
lib/kickboxer/person.rb

Class Method Summary collapse

Class Method Details

.find_by_email(email_address) ⇒ Object

Public: look up a person by email address

email_address - a string containing the email address

Example

response = Kickboxer::Person.find_by_email('[email protected]')
response.contactInfo.familyName
# => 'Lorang'
response.contactInfo.givenName
# => 'Bart'


15
16
17
# File 'lib/kickboxer/person.rb', line 15

def self.find_by_email(email_address)
  Request.run('person', email: email_address)
end

.find_by_facebook(username) ⇒ Object

Public: look up a person by facebook username

username - a string containing the facebook username

Example

response = Kickboxer::Person.find_by_facebook('bart.lorang')
response.contactInfo.familyName
# => 'Lorang'
response.contactInfo.givenName
# => 'Bart'


63
64
65
# File 'lib/kickboxer/person.rb', line 63

def self.find_by_facebook(username)
  Request.run('person', facebookUsername: username)
end

.find_by_phone_number(phone_number) ⇒ Object

Public: look up a person by phone number

phone_number - a string containing the phone number

Example

response = Kickboxer::Person.find_by_phone_number('+13037170414')
response.contactInfo.familyName
# => 'Lorang'
response.contactInfo.givenName
# => 'Bart'


31
32
33
# File 'lib/kickboxer/person.rb', line 31

def self.find_by_phone_number(phone_number)
  Request.run('person', phone: phone_number)
end

.find_by_twitter(username) ⇒ Object

Public: look up a person by twitter username

username - a string containing the twitter username

Example

response = Kickboxer::Person.find_by_twitter('lorangb')
response.contactInfo.familyName
# => 'Lorang'
response.contactInfo.givenName
# => 'Bart'


47
48
49
# File 'lib/kickboxer/person.rb', line 47

def self.find_by_twitter(username)
  Request.run('person', twitter: username)
end