Pure Iterator

A flexible way to process records in the Pure Research Information System.

Status

Gem Version Maintainability

Installation

Add this line to your application's Gemfile:

gem 'pure_iterator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pure_iterator

Usage

class Foo < PureIterator::Base
  def act(response)
    # do something
  end

  def post_endpoint
    'persons'
  end
end
def config
  {
    host: 'pure.example.com',
    username: 'YOUR_PURE_USERNAME',
    password: 'YOUR_PURE_PASSWORD',
    api_key:  'YOUR_PURE_API_KEY',
    api_version: 514
  }
end

iterator = Foo.new config
iterator.accept :json # default is :xml
params = {size: 20} # for pagination, use size and offset
iterator.iterate params

License

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