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

Class Method Summary collapse

Class Attribute Details

.cacheObject

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, options = {})
  options[:method] = method
  options[:regex] = regex
  registered << options
end

.registeredObject

an array of registrations



28
29
30
# File 'lib/web.rb', line 28

def registered
  @registered ||= []
end

.unregister_allObject



23
24
25
# File 'lib/web.rb', line 23

def unregister_all
  @registered = []
end