Class: OmniAuth::Strategies::Etsy
- Inherits:
-
OAuth
- Object
- OAuth
- OmniAuth::Strategies::Etsy
- Defined in:
- lib/omniauth/strategies/etsy.rb
Instance Method Summary collapse
- #callback_phase ⇒ Object
- #prep_sandbox ⇒ Object
- #profile_info ⇒ Object
- #raw_info ⇒ Object
- #request_phase ⇒ Object
- #user_hash ⇒ Object
Instance Method Details
#callback_phase ⇒ Object
37 38 39 40 |
# File 'lib/omniauth/strategies/etsy.rb', line 37 def callback_phase prep_sandbox super end |
#prep_sandbox ⇒ Object
42 43 44 45 46 |
# File 'lib/omniauth/strategies/etsy.rb', line 42 def prep_sandbox if .sandbox ..merge!(:site => "http://sandbox.openapi.etsy.com/v2") end end |
#profile_info ⇒ Object
48 49 50 51 |
# File 'lib/omniauth/strategies/etsy.rb', line 48 def profile_info @profile_info ||= user_hash['Profile'] @profile_info.each { |k,v| @profile_info[k] = '' if v == nil } end |
#raw_info ⇒ Object
53 54 55 |
# File 'lib/omniauth/strategies/etsy.rb', line 53 def raw_info @data ||= user_hash end |
#request_phase ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/omniauth/strategies/etsy.rb', line 29 def request_phase if .scope .request_params.merge!(:scope => .scope.gsub(',', ' ')) end prep_sandbox super end |
#user_hash ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/omniauth/strategies/etsy.rb', line 57 def user_hash @user_hash ||= MultiJson.decode(@access_token.get('/users/__SELF__?includes=Profile').body)['results'][0] rescue ::Errno::ETIMEDOUT raise ::Timeout::Error rescue ::OAuth::Error => e raise e.response.inspect end |