Class: SolidusContent::Providers::Prismic
- Inherits:
-
Object
- Object
- SolidusContent::Providers::Prismic
- Defined in:
- lib/solidus_content/providers/prismic.rb
Class Method Summary collapse
Class Method Details
.call(input) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/solidus_content/providers/prismic.rb', line 7 def call(input) require 'prismic' unless defined?(::Prismic) = input.dig(:type_options) client = ::Prismic.api( [:api_entry_point], .dig(:api_token) ) entry = client.getByID(input.dig(:options, :id)) input.merge( data: entry.fields, provider_client: client, provider_entry: entry, ) end |
.entry_fields ⇒ Object
30 31 32 |
# File 'lib/solidus_content/providers/prismic.rb', line 30 def entry_fields %i[id] end |
.entry_type_fields ⇒ Object
26 27 28 |
# File 'lib/solidus_content/providers/prismic.rb', line 26 def entry_type_fields %i[api_entry_point api_token] end |