Sha256: e40958e44f925a6341f0848e29706e5d5a4f57618b2b2efa14a343b020fb48cf

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

require 'restclient'
require 'lib/hash'      # Dotted notation for hash access
require 'benchmark'
require 'activesupport' # Hash.from_xml

class ESODClient  
  def initialize(url, api_token)
    @url = url
    @token = api_token
  end
  
  def get(resource, id)
    get_path("#{resource}/#{id}")
  end
  
  protected
  
  def get_path(path)
    response = RestClient.get("#{@url}/#{path}.xml?key=#{@token}").to_s
    response_hash = Hash.from_xml(response)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esod-client-0.2.0 lib/esod_client/esod_client.rb