Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elessar

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elessar

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Elessar Ruby Library

Elessar - In the book, Elessar is a green gemstone that is a symbol of the kingship of Gondor.

The Elessar Ruby library provides convenient access to the The Lord of the Rings API from applications written in the Ruby language.

Documentation

See the The Lord of the Rings API docs.

Installation

You don't need this source code unless you want to modify the gem. If you just want to use the package, just run:

gem install elessar

If you want to build the gem from source:

gem build elessar.gemspec

Requirements

  • Ruby 2.3+.

Bundler

If you are installing via bundler, you should be sure to use the https rubygems source in your Gemfile, as any gems fetched over http could potentially be compromised in transit and alter the code of gems fetched securely over https:

gem 'elessar'

Usage

The library needs to be configured with your account's secret key which is available in your The Lord of the Rings Account. Set Elessar.api_key to its value:

require 'elessar'
Elessar.api_key = 'aR9j-...'

# list movies
Elessar::Movie.list()

# retrieve single movie
movie = Elessar::Movie.retrieve('5cd95395de30eff6ebccde5b')

# list quotes
movie.list_quotes()

Params

# using params as hash
Elessar::Movie.list({limit: 3, page: 2})

# using params as string
Elessar::Movie.list("budgetInMillions<100")

Configuring Automatic Retries

You can enable automatic retries on requests that fail due to a transient problem by configuring the maximum number of retries:

Elessar.max_network_retries = 2

Various errors can trigger a retry, like a connection error or a timeout, and also certain API responses like HTTP status 409 Conflict.

Configuring Timeouts

Open, read timeouts are configurable:

Elessar.open_timeout = 30 # in seconds
Elessar.read_timeout = 80

Development

Instructions to run tests:

bundle install

Run all tests:

bundle exec ruby test/run_test.rb

Run a single test:

bundle exec ruby test/elessar_test.rb

FAQs

Package last updated on 06 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc