Module: ContentfulRedis::KeyManager
- Defined in:
- lib/contentful_redis/key_manager.rb
Class Method Summary collapse
-
.attribute_index(klass, attribute) ⇒ Object
Links a contentful models attribute to its contentful_id.
-
.content_model_key(space, endpoint, parameters) ⇒ Object
Links content model request to its contentful json response.
Class Method Details
.attribute_index(klass, attribute) ⇒ Object
Links a contentful models attribute to its contentful_id
7 8 9 |
# File 'lib/contentful_redis/key_manager.rb', line 7 def attribute_index(klass, attribute) "#{klass.space.fetch(:space_id)}/#{klass.content_model}/#{attribute}" end |
.content_model_key(space, endpoint, parameters) ⇒ Object
Links content model request to its contentful json response
12 13 14 |
# File 'lib/contentful_redis/key_manager.rb', line 12 def content_model_key(space, endpoint, parameters) "#{space.fetch(:space_id)}/#{endpoint}/#{parameters.map { |k, v| "#{k}-#{v}" }.join('/')}" end |