Class: SolidusContent::Providers::Contentful
- Inherits:
-
Object
- Object
- SolidusContent::Providers::Contentful
- Defined in:
- lib/solidus_content/providers/contentful.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/contentful.rb', line 7 def call(input) require 'contentful' unless defined?(::Contentful) = input.dig(:type_options) client = ::Contentful::Client.new( space: [:contentful_space_id], access_token: [:contentful_access_token], ) entry = client.entry(input.dig(:options, :entry_id)) input.merge( data: entry.fields, provider_client: client, provider_entry: entry, ) end |
.entry_fields ⇒ Object
30 31 32 |
# File 'lib/solidus_content/providers/contentful.rb', line 30 def entry_fields %i[entry_id] end |
.entry_type_fields ⇒ Object
26 27 28 |
# File 'lib/solidus_content/providers/contentful.rb', line 26 def entry_type_fields %i[contentful_space_id contentful_access_token] end |