Project

edh

0.0
No commit activity in last 3 years
No release in over 3 years
A lightweight, flexible library for EDH Passport
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Build Status Code Climate Coverage Status

####config/initializers

####optional

#Configure passport connection
EDH::Passport.configure do |config|
  config.server = 'http://dummy-passport.dev'
  config.app_access_token = "123456"
end

##Setup a client without a user access token

passport_client = EDH::Passport::API.new

##Setup a client with a user access token

passport_client = EDH::Passport::API.new(:access_token => "user_token")

####create returns an action id

passport_client.create("pages.fundraise", {:abc => "def", :cats => "dogs"})
=> 1234
#sending json example
passport_client.create("pages.fundraise", "{\"abc\":\"def\",\"cats\":\"dogs\"}")

####update an action

passport_client.update(1234, {:abc => "12345", :cats => "6789"})

####delete an action

passport_client.delete(1234)

Errors

Errors that can be raised are:

EDH::Passport::ServerError #5XX error on Passport
EDH::Passport::ClientError #4XX error on Passport
MultiJson::DecodeError #Response decode error
Faraday::Error::ConnectionFailed #connection failure

Testing

Unit tests are provided for all of EDH's methods. By default, these tests run against mock responses and hence are ready out of the box:

# From anywhere in the project directory:
bundle exec rake spec

###Built and tested in:

  • 1.8.7
  • 1.9.2
  • 1.9.3
  • ruby-head
  • jruby-18mode # JRuby in 1.8 mode
  • jruby-19mode # JRuby in 1.9 mode
  • rbx-18mode
  • rbx-19mode
  • ree