Class: Baykit::BayServer::Util::HttpStatus
- Inherits:
-
Object
- Object
- Baykit::BayServer::Util::HttpStatus
- Includes:
- Bcf
- Defined in:
- lib/baykit/bayserver/util/http_status.rb
Constant Summary collapse
- OK =
Known status
200
- MOVED_PERMANENTLY =
301
- MOVED_TEMPORARILY =
302
- NOT_MODIFIED =
304
- BAD_REQUEST =
400
- UNAUTHORIZED =
401
- FORBIDDEN =
403
- NOT_FOUND =
404
- UPGRADE_REQUIRED =
426
- INTERNAL_SERVER_ERROR =
500
- SERVICE_UNAVAILABLE =
503
- GATEWAY_TIMEOUT =
504
- HTTP_VERSION_NOT_SUPPORTED =
505
Class Attribute Summary collapse
-
.initialized ⇒ Object
readonly
Returns the value of attribute initialized.
-
.status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Class Attribute Details
.initialized ⇒ Object (readonly)
Returns the value of attribute initialized.
28 29 30 |
# File 'lib/baykit/bayserver/util/http_status.rb', line 28 def initialized @initialized end |
.status ⇒ Object (readonly)
Returns the value of attribute status.
27 28 29 |
# File 'lib/baykit/bayserver/util/http_status.rb', line 27 def status @status end |
Class Method Details
.description(status_code) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/baykit/bayserver/util/http_status.rb', line 48 def self.description(status_code) desc = @status[status_code] if(desc == nil) BayLog.error("Status #{status_code} is invalid.") return status_code.to_s() else return desc end end |
.init(bcf_file) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/baykit/bayserver/util/http_status.rb', line 33 def self.init(bcf_file) if(@initialized) return end p = BcfParser.new() doc = p.parse(bcf_file) doc.content_list.each do |kv| if(kv.instance_of?(BcfKeyVal)) @status[kv.key.to_i] = kv.value end end @initialized = true end |