Module: Blix::Rest
- Defined in:
- lib/blix/rest/format.rb,
lib/blix/rest.rb,
lib/blix/rest/server.rb,
lib/blix/rest/version.rb,
lib/blix/rest/response.rb,
lib/blix/rest/controller.rb,
lib/blix/rest/string_hash.rb,
lib/blix/rest/format_parser.rb,
lib/blix/rest/request_mapper.rb,
lib/blix/rest/resource_cache.rb
Overview
pass a response object to the controller to set header status and content.
Defined Under Namespace
Modules: ResourceCache
Classes: AuthorizationError, BadRequestError, BinaryData, Controller, FormatParser, HtmlFormatParser, JsonFormatParser, RawFormatParser, RawJsonString, RequestMapper, RequestMapperError, Response, Server, ServiceError, StringHash, XmlFormatParser
Constant Summary
collapse
- MIME_TYPE_JSON =
'application/json'.freeze
- CONTENT_TYPE =
EXPIRED_TOKEN_MESSAGE = ‘token expired’ INVALID_TOKEN_MESSAGE = ‘invalid token’
'Content-Type'.freeze
- CONTENT_TYPE_JSON =
'application/json'.freeze
- CONTENT_TYPE_HTML =
'text/html; charset=utf-8'.freeze
- CONTENT_TYPE_XML =
'application/xml'.freeze
'WWW-Authenticate'.freeze
- CACHE_CONTROL =
'Cache-Control'.freeze
- CACHE_NO_STORE =
'no-store'.freeze
- PRAGMA =
'Pragma'.freeze
- NO_CACHE =
'no-cache'.freeze
- URL_ENCODED =
%r{^application/x-www-form-urlencoded}.freeze
- JSON_ENCODED =
NOTE: “text/json” and “text/javascript” are deprecated forms
%r{^application/json}.freeze
- HTML_ENCODED =
%r{^text/html}.freeze
- XML_ENCODED =
%r{^application/xml}.freeze
- HTTP_DATE_FORMAT =
'%a, %d %b %Y %H:%M:%S GMT'.freeze
- HTTP_VERBS =
%w[GET HEAD POST PUT DELETE OPTIONS PATCH].freeze
- HTTP_BODY_VERBS =
%w[POST PUT PATCH].freeze
- VERSION =
"0.1.30"
Class Method Summary
collapse
Class Method Details
.environment ⇒ Object
the test/development/production environment
30
31
32
|
# File 'lib/blix/rest.rb', line 30
def self.environment
@_environment ||= ENV['RACK_ENV'] || 'development'
end
|
.environment=(val) ⇒ Object
38
39
40
|
# File 'lib/blix/rest.rb', line 38
def self.environment=(val)
@_environment = val.to_s
end
|
.environment?(val) ⇒ Boolean
34
35
36
|
# File 'lib/blix/rest.rb', line 34
def self.environment?(val)
environment == val.to_s
end
|
.full_path(path) ⇒ Object
327
328
329
|
# File 'lib/blix/rest/request_mapper.rb', line 327
def self.full_path(path)
RequestMapper.full_path(path)
end
|
.logger ⇒ Object
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/blix/rest.rb', line 46
def self.logger
@_logger ||= begin
l = Logger.new(STDOUT)
unless l.respond_to? :write
def l.write(*args)
self.<<(*args)
end
end
l
end
end
|
.logger=(val) ⇒ Object
42
43
44
|
# File 'lib/blix/rest.rb', line 42
def self.logger=(val)
@_logger = val
end
|
.no_template_cache=(val) ⇒ Object
509
510
511
|
# File 'lib/blix/rest/controller.rb', line 509
def self.no_template_cache=(val)
Controller.no_template_cache = val
end
|
.path_root ⇒ Object
323
324
325
|
# File 'lib/blix/rest/request_mapper.rb', line 323
def self.path_root
RequestMapper.path_root
end
|
.set_erb_root(*args) ⇒ Object
505
506
507
|
# File 'lib/blix/rest/controller.rb', line 505
def self.set_erb_root(*args)
Controller.set_erb_root(*args)
end
|
.set_path_root(*args) ⇒ Object
319
320
321
|
# File 'lib/blix/rest/request_mapper.rb', line 319
def self.set_path_root(*args)
RequestMapper.set_path_root(*args)
end
|