Module: Oare::Gateway
- Defined in:
- lib/extensions/gateway.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/extensions/gateway.rb', line 3
def method_missing(method, *args, &block)
collection = ::ActiveResource::Base.oauth_enabled_classes
if collection.keys.include? method
constant = collection[method].join('::').constantize
constant.access_token = self.access_token
constant
else
super(method, *args, &block)
end
end
|
Instance Method Details
#access_token ⇒ Object
17
18
19
20
21
22
23
24
25
|
# File 'lib/extensions/gateway.rb', line 17
def access_token
OAuth::AccessToken.new(consumer, oauth_token, oauth_token_secret)
end
|