Module: Blix::Rest
- Defined in:
- lib/blix/rest/format.rb,
lib/blix/rest.rb,
lib/blix/rest/cache.rb,
lib/blix/rest/server.rb,
lib/blix/rest/version.rb,
lib/blix/rest/response.rb,
lib/blix/rest/controller.rb,
lib/blix/rest/redis_cache.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, Cache, Context, Controller, FormatParser, HtmlFormatParser, JsonFormatParser, MemoryCache, RawFormatParser, RawJsonString, RawResponse, RedisCache, 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.7.2"
Class Method Summary
collapse
Class Method Details
.cache_disabled ⇒ Object
48
49
50
|
# File 'lib/blix/rest.rb', line 48
def self.cache_disabled
@_cache_disabled
end
|
.disable_cache ⇒ Object
52
53
54
|
# File 'lib/blix/rest.rb', line 52
def self.disable_cache
@_cache_disabled = true
end
|
.environment ⇒ Object
the test/development/production environment
32
33
34
|
# File 'lib/blix/rest.rb', line 32
def self.environment
@_environment ||= ENV['RACK_ENV'] || 'development'
end
|
.environment=(val) ⇒ Object
40
41
42
|
# File 'lib/blix/rest.rb', line 40
def self.environment=(val)
@_environment = val.to_s
end
|
.environment?(val) ⇒ Boolean
36
37
38
|
# File 'lib/blix/rest.rb', line 36
def self.environment?(val)
environment == val.to_s
end
|
.full_path(path) ⇒ Object
343
344
345
|
# File 'lib/blix/rest/request_mapper.rb', line 343
def self.full_path(path)
RequestMapper.full_path(path)
end
|
.logger ⇒ Object
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/blix/rest.rb', line 56
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
44
45
46
|
# File 'lib/blix/rest.rb', line 44
def self.logger=(val)
@_logger = val
end
|
.no_template_cache=(val) ⇒ Object
.set_erb_root(*args) ⇒ Object
638
639
640
|
# File 'lib/blix/rest/controller.rb', line 638
def self.set_erb_root(*args)
Controller.set_erb_root(*args)
end
|
.set_path_root(*args) ⇒ Object
335
336
337
|
# File 'lib/blix/rest/request_mapper.rb', line 335
def self.set_path_root(*args)
RequestMapper.set_path_root(*args)
end
|