Class: Highrise::Base

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

Direct Known Subclasses

Account, Comment, DealCategory, Email, Group, Membership, Note, Party, Recording, Subject, SubjectData, SubjectField, Tag, Task, TaskCategory, User

Class Method Summary (collapse)

Class Method Details

+ (Object) headers

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

+ (Object) oauth_token=(token)



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

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