nearmiss-ruby

A module for using the Nearmiss REST API and generating valid TwiML. [Click here to read the full documentation.][documentation]

Installation

To install using [Bundler][bundler] grab the latest stable version:

gem 'nearmiss-ruby', '~> 1.0.0'

To manually install nearmiss-ruby via [Rubygems][rubygems] simply gem install:

nearmiss-ruby

A module for using the Nearmiss REST API and generating valid TwiML. [Click here to read the full documentation.][documentation]

Installation

To install using [Bundler][bundler] grab the latest stable version:

gem 'nearmiss-ruby', '~> 1.0.0'

To manually install nearmiss-ruby via [Rubygems][rubygems] simply gem install:

gem install nearmiss-ruby

To build and install the development branch yourself from the latest source:

git clone [email protected]:nearmiss/nearmiss-ruby.git
cd nearmiss-ruby
make install

Getting Started With REST

Setup Work

require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'nearmiss-ruby'

# put your own credentials here
 = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'

# set up a client to talk to the Nearmiss REST API
@client = Nearmiss::REST::Client.new , auth_token

# alternatively, you can preconfigure the client like so
Nearmiss.configure do |config|
  config. = 
  config.auth_token = auth_token
end

# and then you can create a new client without parameters
@client = Nearmiss::REST::Client.new

List Projects

You can look up a list of all projects.

# list calls made or received on or after May 13, 2013
@client.project_list("start_time>" => "2013-05-13") # Notice we omit the "=" in the "start_time>=" parameter because it is automatically added

List Categories

You can look up a list of all defined categories.

# list calls made or received on or after May 13, 2013
@client.categories() # Notice we omit the "=" in the "start_time>=" parameter because it is automatically added

Supported Ruby Versions

This library supports and is [tested against][travis] the following Ruby implementations:

  • Ruby 2.2.0
  • Ruby 2.1.0
  • Ruby 2.0.0
  • Ruby 1.9.3
  • [JRuby][jruby]
  • [Rubinius][rubinius]

Getting help

If you need help installing or using the library, please contact Nearmiss Support at [email protected] first. Nearmiss's Support staff are well-versed in all of the Nearmiss Helper Libraries, and usually reply within 24 hours.

If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!

More Information

There are more detailed examples in the included [examples][examples] directory. Also for those upgrading, the [upgrade guide][upgrade] is available in the [nearmiss-ruby github wiki][wiki].

gem install nearmiss-ruby

To build and install the development branch yourself from the latest source:

git clone [email protected]:nearmiss/nearmiss-ruby.git
cd nearmiss-ruby
make install

Getting Started With REST

Setup Work

require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'nearmiss-ruby'

# put your own credentials here
 = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'

# set up a client to talk to the Nearmiss REST API
@client = Nearmiss::REST::Client.new , auth_token

# alternatively, you can preconfigure the client like so
Nearmiss.configure do |config|
  config. = 
  config.auth_token = auth_token
end

# and then you can create a new client without parameters
@client = Nearmiss::REST::Client.new

List Projects

You can look up a list of all projects.

# list calls made or received on or after May 13, 2013
@client.project_list("start_time>" => "2013-05-13") # Notice we omit the "=" in the "start_time>=" parameter because it is automatically added

List Categories

You can look up a list of all defined categories.

# list calls made or received on or after May 13, 2013
@client.categories() # Notice we omit the "=" in the "start_time>=" parameter because it is automatically added

Supported Ruby Versions

This library supports and is [tested against][travis] the following Ruby implementations:

  • Ruby 2.2.0
  • Ruby 2.1.0
  • Ruby 2.0.0
  • Ruby 1.9.3
  • [JRuby][jruby]
  • [Rubinius][rubinius]

Getting help

If you need help installing or using the library, please contact Nearmiss Support at [email protected] first. Nearmiss's Support staff are well-versed in all of the Nearmiss Helper Libraries, and usually reply within 24 hours.

If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!

Development

If you want to hack on Nearmiss locally, we try to make bootstrapping the project as painless as possible. To start hacking, clone and run:

To get started call

./script/bootstrap

To build the gem, call the following from the terminal:

./script/package

To push new version to RubyGem and create a git version tag:

./script/release

More Information

There are more detailed examples in the included [examples][examples] directory. Also for those upgrading, the [upgrade guide][upgrade] is available in the [nearmiss-ruby github wiki][wiki].