Class: Line::Social::Request::Profile

Inherits:
Base
  • Object
show all
Defined in:
lib/line/social/request/profile.rb

Constant Summary collapse

API_URI =
URI.parse("https://api.line.me/v2")

Instance Method Summary collapse

Methods inherited from Base

#http_client

Instance Method Details

#get(access_token) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/line/social/request/profile.rb', line 7

def get(access_token)
  response = http_client(:get) do |request|
    request.url "#{API_URI}/profile"
    request.headers["Authorization"] =  "Bearer #{access_token}"
  end

  Line::Social::Profile.new(response.body)
end