class Ramco::Connection

Attributes

api_key[R]
hash[R]

Public Class Methods

new(hash={}) { |builder| ... } click to toggle source

Instantiates connection, accepts an options hash for authenticated access

Ramco expects

:key => "API Key"
Calls superclass method
# File lib/ramco/connection.rb, line 15
def initialize(hash={})
  @hash = hash
  @api_key = hash[:api_key] if hash.has_key? :api_key

  super(hash[:api_url] || 'https://api.ramcoams.com/api/v2/') do |builder|
    yield builder if block_given?
    builder.use     Faraday::Response::RaiseRamcoError
    builder.use     FaradayMiddleware::EncodeJson
    builder.use     FaradayMiddleware::ParseJson
    builder.adapter :typhoeus
  end
end