Exception: OAuth::Unauthorized

Inherits:
Error
  • Object
show all
Defined in:
lib/oauth/errors/unauthorized.rb

Direct Known Subclasses

Problem

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#requestObject (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_sObject



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