Skip to content

talho/EMCrud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EMCrud

EMCrud is a CRUDish interface to EMSystems’ EMCredential volunteer registration system. If you don’t know anything about EMSystems or EMCredential, you are very likely looking at the wrong library. The authors of this library have no affiliation with EMSystems, and EMCrud is not supported by EMSystems in any way, so do not contact them for support.

Usage

There are two basic usage scenarios. In the first, you are trying to programmatically submit a volunteer’s registration info into EMCredential for verification. In the second, you are searching for volunteers that meet certain criteria.

Authentication

Before you can perform either task, you must obtain valid user credentials from EMSystems. Once obtained, you can use the credentials in the following manner:

@credentials = YAML::load_file(filename)[environment]
@session = EMCrud.authenticate @credentials['username'], @credentials['password']

Registration

To register, create an EMCrud::Registration instance, which will load some data from the destination server that allows some introspection.

@reg = EMCrud::Registration.new
#find out what events are in the system
puts @reg.events
@reg.event = @reg.events.first
@reg.profession = "Dentist"
#fill in remaining fields
#...

Required fields are Registration.event, Registration.passwordChallenge, Registration.challengeResponse, Registration.firstName, and Registration.lastName. Valid values for Registration.event and Registration.passwordChallenge are found in the Registration.events and Registration.passwordChallenges collections, respectively.

An instance of EMCrud::Search is created to search EMCredential for volunteers by first and last name.

@search = EMCrud::Search.new
@search.firstName = "Bob"
@search.lastName = "Smith"
@volunteers = @search.search

The returned collection of EMCrud::Volunteer instances is all of the volunteers that matched the given name. More details on each volunteer can be found by interrogating the Volunteer.field_names collection, which contains all of the fields EMCredential returns on the record.

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but

    bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 TALHO. See LICENSE for details.

About

interface to TX-ESAR-VHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages