Module: Web
- Defined in:
- lib/web.rb,
lib/web/faker.rb,
lib/web/version.rb,
lib/web/response.rb,
lib/web/ext/net_http.rb,
lib/web/http_response.rb,
lib/web/cache/redis_cache.rb,
lib/web/cache/memory_cache.rb,
lib/web/cache/memcached_cache.rb
Defined Under Namespace
Modules: HTTPResponse, ReadableHTTPResponse Classes: Faker, MemcachedCache, MemoryCache, RedisCache, Response
Constant Summary collapse
- VERSION =
'0.1.0'
Class Attribute Summary collapse
-
.cache ⇒ Object
Get the cache we’re using.
Class Method Summary collapse
-
.register(method, regex, options = {}) ⇒ Object
register a url to cache.
-
.registered ⇒ Object
an array of registrations.
- .unregister_all ⇒ Object
Class Attribute Details
.cache ⇒ Object
Get the cache we’re using
33 34 35 |
# File 'lib/web.rb', line 33 def cache @cache ||= MemoryCache.new end |
Class Method Details
.register(method, regex, options = {}) ⇒ Object
register a url to cache
17 18 19 20 21 |
# File 'lib/web.rb', line 17 def register(method, regex, = {}) [:method] = method [:regex] = regex registered << end |
.registered ⇒ Object
an array of registrations
28 29 30 |
# File 'lib/web.rb', line 28 def registered @registered ||= [] end |
.unregister_all ⇒ Object
23 24 25 |
# File 'lib/web.rb', line 23 def unregister_all @registered = [] end |