Wrap APIs with easiness and flexibility.
Heckle usually refers to Jeckle familiarly, as "chum" or "pal", while Jeckle often calls Heckle "old chap", "old thing", "old boy" or "old featherhead", indicating a close friendship between them.
Let third party APIs be Heckle for your app's Jeckle.
Add this line to your application's Gemfile:
gem 'jeckle'
And then execute:
$ bundle
We recommend to create a initializer:
# config/initializers/jeckle.rb
Jeckle.configure do |config|
config.register :some_service do |api|
api.base_uri = 'http://api.someservice.com'
api.headers = {
'Accept' => 'application/json'
}
api.namespaces = { prefix: 'api', version: 'v1' }
api.logger = Rails.logger
api.read_timeout = 5
end
end
And then put your API stuff scoped inside a services
folder:
# app/services/some_service/models/my_resource.rb
module SomeService
module Models
class MyResource
include Jeckle::Resource
api :some_service
attribute :id
end
end
end
- Faraday middleware abstraction
- Per action API
- Comprehensive restful actions
- Testability