Module: Web

Defined in:
lib/web.rb,
lib/web/faker.rb,
lib/web/version.rb,
lib/web/response.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 Classes: Faker, MemcachedCache, MemoryCache, RedisCache, Response

Constant Summary collapse

VERSION =
'0.0.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.cacheObject

Get the cache we’re using



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

def cache
  @cache ||= RedisCache.new
end

Class Method Details

.register(method, regex, options = {}) ⇒ Object

register a url to cache



16
17
18
19
20
# File 'lib/web.rb', line 16

def register(method, regex, options = {})
  options[:method] = method
  options[:regex] = regex
  registered << options
end

.registeredObject

an array of registrations



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

def registered
  @registered ||= []
end