Celsius::Primo

Build Status Test Coverage Code Climate

Celsius::Primo aims to provide an adapter layer above various Primo apis. The goal is, to use primo in a way similar to Elasticsearch by translating Elasticsearch requests to Primo requests and vice versa.

Usage

require "celsius/primo"

adapter = Celsius::Primo::Adapter.new({
  institution: "PAD",
  languages: [
    "ger",
    "eng"
  ],
  locations:[
    {
      type: "local",
      value: "scope:(PAD_ALEPH)"
    }
  ],
  soap_api_options: {
    searcher_url: "http://primo.kobv.de/primo_library/libweb/webservices/services/searcher"
  }
})

adapter.search({
  # Elasticsearch style search request
  from: 0,
  size: 20,
  query: {
    bool: {
      must: [
        query_string: {
          default_operator: "AND",
          fields: ["_all"],
          query: "linux"
        }
      ]
    }
  }
}) # => Elasticsearch style response

Contributing

  1. Fork it ( https://github.com/[my-github-username]/celsius-primo/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request