Class: Renderful::Provider::Prismic

Inherits:
Base
  • Object
show all
Defined in:
lib/renderful/provider/prismic.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

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(options)
  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_prefixObject



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