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:



25
26
27
28
# File 'lib/webrick/httpstatus.rb', line 25

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

Class Attribute Details

.codeObject (readonly)

:nodoc:



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

def code
  @code
end

.reason_phraseObject (readonly)

:nodoc:



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

def reason_phrase
  @reason_phrase
end

Instance Method Details

#codeObject Also known as: to_i

Returns the HTTP status code



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

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

#reason_phraseObject

Returns the HTTP status description



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

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