Class: BitClust::NotFoundScreen

Inherits:
Screen show all
Includes:
HTMLUtils
Defined in:
lib/bitclust/screen.rb

Constant Summary

Constants included from NameUtils

BitClust::NameUtils::CHAR_TO_MARK, BitClust::NameUtils::CHAR_TO_NAME, BitClust::NameUtils::CLASS_NAME_RE, BitClust::NameUtils::CLASS_PATH_RE, BitClust::NameUtils::CONST_PATH_RE, BitClust::NameUtils::CONST_RE, BitClust::NameUtils::GVAR_RE, BitClust::NameUtils::LIBNAME_RE, BitClust::NameUtils::MARK_TO_CHAR, BitClust::NameUtils::MARK_TO_NAME, BitClust::NameUtils::METHOD_NAME_RE, BitClust::NameUtils::METHOD_SPEC_RE, BitClust::NameUtils::MID, BitClust::NameUtils::NAME_TO_CHAR, BitClust::NameUtils::NAME_TO_MARK, BitClust::NameUtils::TYPEMARK_RE

Instance Method Summary collapse

Methods included from NameUtils

build_method_id, classid2name, classname2id, classname?, decodeid, decodename_fs, decodename_url, encodeid, encodename_fs, encodename_rdocurl, encodename_url, functionname?, gvarname?, html_filename, libid2name, libname2id, libname?, method_spec?, methodid2classid, methodid2libid, methodid2mname, methodid2specparts, methodid2specstring, methodid2typechar, methodid2typemark, methodid2typename, methodname?, split_method_id, split_method_spec, typechar2mark, typechar2name, typechar?, typemark2char, typemark2name, typemark?, typename2char, typename2mark, typename?

Methods inherited from Screen

for_entry, #response

Constructor Details

#initialize(err) ⇒ NotFoundScreen

Returns a new instance of NotFoundScreen.


232
233
234
# File 'lib/bitclust/screen.rb', line 232

def initialize(err)
  @error = err
end

Instance Method Details

#bodyObject


244
245
246
247
248
249
250
251
252
253
254
# File 'lib/bitclust/screen.rb', line 244

def body
  <<-EndHTML
<html>
<head><title>NotFound</title></head>
<body>
<h1>NotFound</h1>
<pre>#{escape_html(@error.message)} (#{escape_html(@error.class.name)})</pre>
</body>
</html>
  EndHTML
end

#content_typeObject


240
241
242
# File 'lib/bitclust/screen.rb', line 240

def content_type
  'text/html'
end

#statusObject


236
237
238
# File 'lib/bitclust/screen.rb', line 236

def status
  404
end