Class: ApiUserAuth::Providers::Instagram
- Inherits:
-
Object
- Object
- ApiUserAuth::Providers::Instagram
- Defined in:
- lib/api_user_auth/providers/instagram.rb
Overview
Constant Summary collapse
- API_PATH =
'https://api.instagram.com/v1/users/self/'.freeze
Class Method Summary collapse
Instance Method Summary collapse
- #api_info_url ⇒ Object
- #get_user_data ⇒ Object
-
#initialize(token) ⇒ Instagram
constructor
A new instance of Instagram.
- #user_data ⇒ Object
Constructor Details
#initialize(token) ⇒ Instagram
Returns a new instance of Instagram.
7 8 9 10 |
# File 'lib/api_user_auth/providers/instagram.rb', line 7 def initialize(token) @token = token @data = {} end |
Class Method Details
Instance Method Details
#api_info_url ⇒ Object
12 13 14 15 16 17 |
# File 'lib/api_user_auth/providers/instagram.rb', line 12 def api_info_url params = { access_token: @token } URI("#{API_PATH}?#{params.to_query}") end |
#get_user_data ⇒ Object
19 20 21 22 |
# File 'lib/api_user_auth/providers/instagram.rb', line 19 def get_user_data api_get_request user_data end |
#user_data ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/api_user_auth/providers/instagram.rb', line 24 def user_data { id: @data[:id], name: @data[:full_name], email: "#{@data[:username]}@instagram.com", provider: 'instagram', img_url: @data[:profile_picture], info: {} } end |