tapajos / highrise

Ruby wrapper around Highrise API.
MIT License
124 stars 77 forks source link

Add support to OAuth token authorization in Highrise #45

Closed tjsousa closed 11 years ago

tjsousa commented 11 years ago

As ActiveResource::Base headers aren't inherited by subclasses, this patch was needed in order to support OAuth 2.0 token authorization with Highrise.

With this it becomes possible to use this gem for the scenario asked in #15, by doing:

$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
require 'highrise'
require 'pp'

Highrise::Base.site = 'https://example.highrisehq.com'
#Highrise::Base.user = 'xxx'
Highrise::Base.oauth_token = 'YOUR TOKEN HERE'

@tags = Highrise::Tag.find(:all)

pp @tags