Skip to content

Commit

Permalink
master系APIのレスポンスに含まれるtokenのend_dateに対応
Browse files Browse the repository at this point in the history
  • Loading branch information
yuuna committed Oct 21, 2015
1 parent d90f04b commit 6eba0e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/ne_api.rb
Expand Up @@ -11,6 +11,8 @@ module NeAPI
NE_SERVER_HOST = "https://base.next-engine.org"

private


def conn
@conn ||= Faraday::Connection.new(url: API_SERVER_HOST) do |builder|
builder.use Faraday::Request::UrlEncoded
Expand All @@ -34,7 +36,7 @@ def response response

class Master
include NeAPI
attr_accessor :access_token, :refresh_token, :wait_flag, :retry_num, :wait_interval
attr_accessor :access_token, :refresh_token, :wait_flag, :retry_num, :wait_interval, :access_token_end_date, :refresh_token_end_date
PATH_PREFIX="/api_v1_"

def initialize access_token: "", refresh_token: ""
Expand Down Expand Up @@ -83,6 +85,8 @@ def post method: nil , model: nil, query: nil, fields: nil, get_key: nil, params

@access_token = res["access_token"] if res["access_token"].present?
@refresh_token = res["refresh_token"] if res["refresh_token"].present?
@access_token_end_date = res["access_token_end_date"] if res["access_token_end_date"].present?
@refresh_token_end_date = res["refresh_token_end_date"] if res["refresh_token_end_date"].present?

get_key.present? ? res[get_key] : res
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ne_api/version.rb
@@ -1,3 +1,3 @@
module NeApi
VERSION = "0.0.6"
VERSION = "0.0.7"
end

0 comments on commit 6eba0e0

Please sign in to comment.