GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Logo Logo white GoRails
  • Path
  • Series
  • Lessons
  • Forum
  • Pricing
  • Log In
  • Sign Up

This view

  • Original page
  • New address

GeezerVison is showing gorails.com — API Wrapper Rubygems | GoRails

API Wrapper Rubygems

Ever wondered how to build a Rubygem that wraps an API to make it easier to use in Ruby? You've come to the right place. We'll walk through everything step-by-step covering everything from HTTP requests, converting JSON responses to Ruby objects, and even testing.

Start Series
API HTTP Requests using Faraday 18m
5 Lessons | 1h 30m | Intermediate
API HTTP Requests using Faraday 18m

API HTTP Requests using Faraday

Aug 19, 2021

The first step in building an API wrapper Rubygem is building your HTTP client. We're going to use Faraday as our HTTP client and get it setup with authentication.

8

Transforming JSON responses to Ruby objects with OpenStruct 18m

Transforming JSON responses to Ruby objects with OpenStruct

Aug 24, 2021 Pro

When you receive a JSON response from an API endpoint, it's really easy to convert this to a Ruby hash. But hashes don't feel very Ruby-ish when you're working with them and you can't add methods and treat them like objects.

4

Mapping API Resources & Handling Pagination 16m

Mapping API Resources & Handling Pagination

Aug 31, 2021 Pro

The core of an API wrapper Rubygem is defining the Resource endpoints so developers can make requests cleanly. We'll also learn how to handle pagination for endpoints that return a list of results.

3

API CRUD Actions 11m

API CRUD Actions

Sep 07, 2021 Pro

The core of any API wrapper is the actions for create, read, update, and delete. We'll implement the CRUD for a resource so you can see how to do it and wire up everything together that we've built so far.

4

Testing API Requests 25m

Testing API Requests

Sep 14, 2021 Pro

How do we test API requests in a Rubygem to make sure that we're integrating correctly with our backend? We'll learn how to use stubs to fake out the request and test our code without any network requests.

1

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.