Class: Highrise::Base

Inherits:
ActiveResource::Base
  • Object
show all
Defined in:
lib/highrise/base.rb

Class Method Summary collapse

Class Method Details

.headersObject

If headers are not defined in a given subclass, then obtain headers from the superclass. opensoul.org/blog/archives/2010/02/16/active-resource-in-practice/



11
12
13
14
15
16
17
18
19
# File 'lib/highrise/base.rb', line 11

def headers
  if defined?(@headers)
    @headers
  elsif superclass != Object && superclass.headers
    superclass.headers
  else
    @headers ||= {}
  end
end

.oauth_token=(token) ⇒ Object



21
22
23
# File 'lib/highrise/base.rb', line 21

def oauth_token=(token)
  headers['Authorization'] = "Bearer #{token}"
end