Sha256: 63d30d70561a180ed3604167c6ff9c080f4820dd41a5b305316259a279b8adb8

Contents?: true

Size: 349 Bytes

Versions: 3

Compression:

Stored size: 349 Bytes

Contents

require "httparty"
module Esha
  class Api
    include HTTParty

    base_uri 'api.esha.com'
    format :json

    def self.key=(key)
      default_params apikey: key
    end

    def method_missing(method, *args)
      if @attributes.keys.include?(method.to_s)
        @attributes[method.to_s]
      else
        super
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
esha-0.0.3 lib/esha/api.rb
esha-0.0.2 lib/esha/api.rb
esha-0.0.1 lib/esha/api.rb