Sha256: bff76e2478da0b33a0ea76e057e189ca619c4203055b21bbbd327765ee362ec1

Contents?: true

Size: 406 Bytes

Versions: 4

Compression:

Stored size: 406 Bytes

Contents

module ChatWork
  class Client < BaseClient
    def initialize(api_key, access_token, api_base, api_version)
      if api_key
        super(api_base, api_version, { "X-ChatWorkToken" => api_key })
      elsif access_token
        super(api_base, api_version, { "Authorization" => "Bearer #{access_token}" })
      else
        raise "Either api_key or access_token is required"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chatwork-0.7.0 lib/chatwork/client.rb
chatwork-0.6.2 lib/chatwork/client.rb
chatwork-0.6.1 lib/chatwork/client.rb
chatwork-0.6.0 lib/chatwork/client.rb