Access API
A ruby wrapper for the Access API
Installation
gem 'access', path: '../api-ruby'
And then execute:
$ bundle
Or install it yourself as:
$ gem install access
Setup
Config setup
You can configure the following options:
access_tokenRequiredformatSet as "json" or "xml". Default is "json"api_environmentSet as "staging" or "production". Default is "staging"api_version"v1" is default.hashifyReturns the results all using Hashie::Mash if "true", Default is "false"
You can set these buy creating environment variables called:
ENV['ACCESS_TOKEN'], ENV['ACCESS_FORMAT'], ENV['ACCESS_ENVIRONMENT'], ENV['ACCESS_VERSION'], ENV['ACCESS_HASHIFY']
or create an initializer file and set your config
Access.configure do |config|
config.access_token = ENV['ACCESS_TOKEN']
config.hashify = "true"
end
You can also set them one at a time
Access.config.format = 'xml
Making Calls
Offer
Access::Offer.search options
Access::Offer.find offer_key options member_key required
Store
Access::Store.search options
Access::Store.find store_key options
Location
Access::Location.search options
Access::Location.find location_key options
Category
Access::Category.search options
Access::Category.find key options
Report
Access::Report.usage options
Access::Report.usage token options
Token
Access::Token.verify options
Access::Token.verify_other token options
Redeem
Access::Redeem.redeem_offer key nil options member_key required
Access::Redeem.redeem_offer key redeem_type options member_key required
Member
Contributing
- Fork it ( https://github.com/access-development/api-ruby/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request