Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

43 lines (32 sloc) 1.055 kB

my_emma

Post requests to MyEmma.com’s Remote Signup API.

Installation

sudo gem install hashrocket-my_emma

Usage


>> MyEmma.credentials = {
     :emma_account_id => '9999',
     :signup_post => '8888',
     :username => 'user',
     :password => 'pass'
   }
>> response = MyEmma.signup("test@example.com")
=> #<MyEmma::Response:0x11ba840 @response="1", @code=1>
>> response.success?
=> true
>> response.failed?
=> false
>> response.added_member?
=> true

>> response = MyEmma.signup("test@example.com")
=> #<MyEmma::Response:0x11ba840 @response="2", @code=2>
>> response.updated_member?
=> true

>> MyEmma.signup("joe@example.com", {:emma_member_name_first => "Joe", :emma_member_name_last => "Piscopo"})
=> #<MyEmma::Response:0x11809b0 @response="1", @code=1>

# Assign member to group with an ID of 12345 
>> MyEmma.signup("groupie@example.com", "group[12345]" => 1)
=> <MyEmma::Response:0x113a6f4 @response="1", @code=1>

Copyright

Copyright © 2009 Hashrocket. See MIT_LICENSE for details.

Jump to Line
Something went wrong with that request. Please try again.