Class: Renderful::Provider::Prismic
- Defined in:
- lib/renderful/provider/prismic.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #cache_keys_to_invalidate(_webhook_body) ⇒ Object
- #cache_prefix ⇒ Object
- #find_entry(entry_id) ⇒ Object
-
#initialize(options) ⇒ Prismic
constructor
A new instance of Prismic.
Constructor Details
#initialize(options) ⇒ Prismic
Returns a new instance of Prismic.
6 7 8 9 10 |
# File 'lib/renderful/provider/prismic.rb', line 6 def initialize() super fail ArgumentError, 'prismic option is required!' unless prismic end |
Instance Method Details
#cache_keys_to_invalidate(_webhook_body) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/renderful/provider/prismic.rb', line 23 def cache_keys_to_invalidate(_webhook_body) { keys: [], patterns: ['renderful/prismic/*'], } end |
#cache_prefix ⇒ Object
12 13 14 |
# File 'lib/renderful/provider/prismic.rb', line 12 def cache_prefix :prismic end |
#find_entry(entry_id) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/renderful/provider/prismic.rb', line 16 def find_entry(entry_id) entry = prismic.getByID(entry_id) raise Error::EntryNotFoundError, entry_id unless entry wrap_entry(entry) end |