Class: SolidusContent::EntryType
Instance Method Summary
collapse
#provider_based_attr_reader
Instance Method Details
#content_for(entry) ⇒ Object
20
21
22
23
24
25
26
27
28
|
# File 'app/models/solidus_content/entry_type.rb', line 20
def content_for(entry)
provider_class.call(
slug: entry.slug,
type: name,
provider: provider_name,
options: entry.options.symbolize_keys,
type_options: options.symbolize_keys,
)
end
|
#entry_type_fields ⇒ Object
38
39
40
41
42
|
# File 'app/models/solidus_content/entry_type.rb', line 38
def entry_type_fields
return unless provider_name
provider_class.entry_type_fields
end
|
#provider_class ⇒ Object
30
31
32
|
# File 'app/models/solidus_content/entry_type.rb', line 30
def provider_class
SolidusContent.config.providers[provider_name.to_sym]
end
|
#provider_name_readonly? ⇒ Boolean
34
35
36
|
# File 'app/models/solidus_content/entry_type.rb', line 34
def provider_name_readonly?
persisted?
end
|