Fifthgear
Ruby gem for interfacing with Fifthgear's api
Installation
Add this line to your application's Gemfile:
gem 'fifthgear'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fifthgear
Usage
Configuration
Fifthgear.configure do |config|
config.api_root = 'https://commerceservicestest.infifthgear.com'
config.api_version = '/v2.0/CommerceServices.svc/Rest'
config.username = 'foo'
config.password = 'bar'
config.company_id = 'big_time_biz_1234'
config.content_type = 'application/json'
config.debug = true
end
Helpers
Fifthgear requires dates to be in a specific format. We've added a helper function for formatting the dates correctly. Internally it uses Chronic to parse the date.
irb(main):001:0> Fifthgear::Helper.format_date('12/01/2014')
=> "Date(1417464000000-0800)"
irb(main):002:0> Fifthgear::Helper.format_date('12/01/2014 12:12:12')
=> "Date(1417464732000-0800)"
irb(main):003:0>
Contributing
- Fork it ( https://github.com/WalkerAndCoBrandsInc/fifthgear/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