Laa::ApplyForLegalAid::Api

This is an HTTP client gem to perform calls to the LAA Apply for legal aid API.

CircleCI

Installation

Add this line to your application's Gemfile:

gem 'laa-apply-for-legalaid-api-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install laa-apply-for-legalaid-api-client

Usage

  • Configure the client:
# In a Rails application, this configuration is normally
# setup in an initializer
Laa::ApplyForLegalAid::Api.configure do |c|
  c.host = 'http://your-api-host-name'
end
  • Get an instance of the client:
# This instance will use configurations setup in the previous step
api_client = Laa::ApplyForLegalAid::Api.client
  • Performing requests
# e.g:
api_client.create_application(application_params)
api_client.get_application(application_ref)

Development

Setup

After checking out the repo, run:

bin/setup

to install dependencies.

Running tests

rake spec

Interactive prompt

You can also run bin/console for an interactive prompt that will allow you to experiment

Release process

To install this gem onto your local machine:

bundle exec rake install

To release a new version, update the version number in version.rb, and then run:

bundle exec rake release

which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

NOTE: In case some error like the following happens:

Pushed git commits and tags.
rake aborted!
Your rubygems.org credentials aren't set. Run `gem push` to set them.

Tasks: TOP => release => release:rubygem_push
(See full trace by running task with --trace)

gem push needs to be setup using the email: [email protected] (authentication details are available in the internal Rattic password manager).

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ministryofjustice/laa-apply-for-legalaid-api-ruby-client/issues.

License

The gem is available as open source under the terms of the MIT License.