Sha256: d7a3555ad5d24f6062c39b1b365e10db12880ea0220814c3db95709519be8f11
Contents?: true
Size: 529 Bytes
Versions: 2
Compression:
Stored size: 529 Bytes
Contents
require 'json' require 'httparty' require 'ga_example_gem/configuration' module GaExampleGem # This is our client that we can initialize with # GaExampleGem.new class Client include GaExampleGem::Configuration include HTTParty # This resets our API keys when it is initialized def initialize reset end # This method gets the JSON for a single XKCD comic # by number def get_xkcd(number) JSON.parse self.class.get("http://xkcd-unofficial-api.herokuapp.com/xkcd?num=#{number}") end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ga_example_gem-0.0.2 | lib/ga_example_gem/client.rb |
ga_example_gem-0.0.1 | lib/ga_example_gem/client.rb |