This is a demo client/server for working with a paginated API as a lazy stream.
If you'd like to try this out yourself:
- Clone the project
- Run
bundle install
in the root of the project - Boot a server with
bundle exec rackup
- Boot the client (in a separate terminal) with
ruby client.rb
The client.rb
file contains the Names::Client
class as well as the following
lines at the end:
client = Names::Client.new
require "pry"; binding.pry
puts "done"
This means running ruby client.rb
will boot up a Pry console with the Client
class already loaded and an instance already created for you to play around
with.
The name popularity data was based on the US Social Security Administration's list of most popular names for 2015