Class: OAuth::Unauthorized — Documentation by YARD 0.9.44

# Class: OAuth::Unauthorized

Inherits:
  Error
  - Object
  - Error
  - OAuth::Unauthorized
  show all

Defined in:
  lib/oauth/errors/unauthorized.rb

## Direct Known Subclasses

Problem

## Instance Attribute Summary collapse

- #request ⇒ Object readonly

  Returns the value of attribute request.

## Instance Method Summary collapse

- #initialize(request = nil) ⇒ Unauthorized constructor

  A new instance of Unauthorized.

- #to_s ⇒ Object

## Constructor Details

### #initialize(request = nil) ⇒ `Unauthorized`

Returns a new instance of Unauthorized.

    7
    8
    9
    10
    # File 'lib/oauth/errors/unauthorized.rb', line 7

    def initialize(request = nil)
      super()
      @request = request
    end

## Instance Attribute Details

### #request ⇒ `Object` (readonly)

Returns the value of attribute request.

    5
    6
    7
    # File 'lib/oauth/errors/unauthorized.rb', line 5

    def request
      @request
    end

## Instance Method Details

### #to_s ⇒ `Object`

    12
    13
    14
    15
    16
    # File 'lib/oauth/errors/unauthorized.rb', line 12

    def to_s
      return "401 Unauthorized" if request.nil?

      "#{request.code} #{request.message}"
    end