Sha256: 6a44e4554d9637c84a6e9fc9eaf26f6ef3b920f76f2e65a33171ae6b07f873d9

Contents?: true

Size: 701 Bytes

Versions: 14

Compression:

Stored size: 701 Bytes

Contents

module RDStation
  class Authorization
    attr_reader :refresh_token
    attr_accessor :access_token, :access_token_expires_in
    def initialize(access_token:, refresh_token: nil, access_token_expires_in: nil)
      @access_token = access_token
      @refresh_token = refresh_token
      @access_token_expires_in = access_token_expires_in
      validate_access_token access_token
    end

    def headers
      { "Authorization" => "Bearer #{@access_token}", "Content-Type" => "application/json" }
    end

    private

    def validate_access_token(access_token)
      access_token_msg = ':access_token is required'
      raise ArgumentError, access_token_msg unless access_token
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rdstation-ruby-client-2.9.0 lib/rdstation/authorization.rb
rdstation-ruby-client-2.8.2 lib/rdstation/authorization.rb
rdstation-ruby-client-2.8.1 lib/rdstation/authorization.rb
rdstation-ruby-client-2.8.0 lib/rdstation/authorization.rb
rdstation-ruby-client-2.7.0 lib/rdstation/authorization.rb
rdstation-ruby-client-2.6.0 lib/rdstation/authorization.rb
rdstation-ruby-client-2.5.3 lib/rdstation/authorization.rb
rdstation-ruby-client-2.5.2 lib/rdstation/authorization.rb
rdstation-ruby-client-2.5.1 lib/rdstation/authorization.rb
rdstation-ruby-client-2.5.0 lib/rdstation/authorization.rb
rdstation-ruby-client-2.4.0 lib/rdstation/authorization.rb
rdstation-ruby-client-2.3.1 lib/rdstation/authorization.rb
rdstation-ruby-client-2.3.0 lib/rdstation/authorization.rb
rdstation-ruby-client-2.2.0 lib/rdstation/authorization.rb