This gem provides access to the HTTP Accela API. The project's primary goal is to emulate the ActiveRecord API as far as it makes sense against the Accela API.
Versioning is not semantic but instead reflects the supported version of Accela's Construct API.
Creating a new instance:
Accela::Record.new
Accela::Record.new housing_units: 98
The following methods communicate directly with the Accela REST API.
Here is an example workflow:
input_record = Accela::Record.new housing_units: 829,
type: { type.id = "Building-Commercial-Addition-NA" }
record = Accela::RecordAPI.create_record(input_record)
record.id # => "ISLANDTON-14CAP-00000-000CR"
Most models support the all
and find
methods. These work similar to ActiveRecord. all
returns all records for a given type (with a few caveats). Find accepts an id
paramater and returns a single instance with the given id
.
records = Accela::RecordAPI.get_all_records
records.length # => 25
record = Accela::RecordAPI.get_records("ISLANDTON-14CAP-00000-000CR")
record.name # => "D-I Builders Development Model Home"
To begin:
$ git clone git@github.com:d-i/accela-ruby.git
$ cd accela-ruby
$ bundle install
$ rake test
$ rake console
The built in Rake task rake console
will load the gem and a development environment in a Pry REPL. If you plan on making authentication protected API calls, make sure to log in first. e.g.:
Accela::API.connection.login("developer", "accela", "records addresses")
$ rake gem
$ rake clean