Exception: WEBrick::HTTPStatus::Status

Inherits:
StandardError
  • Object
show all
Defined in:
lib/webrick/httpstatus.rb

Overview

Root of the HTTP status class hierarchy

Direct Known Subclasses

Error, Info, Redirect, Success

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Status

:nodoc:



23
24
25
26
# File 'lib/webrick/httpstatus.rb', line 23

def initialize(*args) # :nodoc:
  args[0] = AccessLog.escape(args[0]) unless args.empty?
  super(*args)
end

Class Attribute Details

.codeObject (readonly)

:nodoc:



28
29
30
# File 'lib/webrick/httpstatus.rb', line 28

def code
  @code
end

.reason_phraseObject (readonly)

:nodoc:



28
29
30
# File 'lib/webrick/httpstatus.rb', line 28

def reason_phrase
  @reason_phrase
end

Instance Method Details

#codeObject Also known as: to_i

Returns the HTTP status code



32
# File 'lib/webrick/httpstatus.rb', line 32

def code() self::class::code end

#reason_phraseObject

Returns the HTTP status description



35
# File 'lib/webrick/httpstatus.rb', line 35

def reason_phrase() self::class::reason_phrase end