Class: Socialmod::Base

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

Direct Known Subclasses

Dashboard, Item, User

Constant Summary collapse

@@headers =
{}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Base

Returns a new instance of Base.



27
28
29
30
31
32
33
34
35
# File 'lib/socialmod.rb', line 27

def initialize(*args)
  super(*args)
  if Base.callback_url
    attributes["callback_url"] ||= Base.callback_url
  end
  if respond_to?(:after_initialize)
    send(:after_initialize)
  end
end

Class Method Details

.api_key=(key) ⇒ Object



13
14
15
16
# File 'lib/socialmod.rb', line 13

def api_key=(key)
  self.headers['Authorization'] = key
  @@api_key = key
end

.callback_urlObject



22
23
24
# File 'lib/socialmod.rb', line 22

def callback_url
  @@callback_url ||= nil
end

.callback_url=(url) ⇒ Object



18
19
20
# File 'lib/socialmod.rb', line 18

def callback_url=(url)
  @@callback_url = url
end