Class: SolidusContent::Providers::JSON
- Inherits:
-
Object
- Object
- SolidusContent::Providers::JSON
- Defined in:
- lib/solidus_content/providers/json.rb
Class Method Summary collapse
Class Method Details
.call(input) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/solidus_content/providers/json.rb', line 9 def call(input) dir = Rails.root.join(input.dig(:type_options, :path)) file = dir.join(input[:slug] + '.json') data = ::JSON.parse(file.read, symbolize_names: true) input.merge(data: data) end |
.entry_fields ⇒ Object
21 22 23 |
# File 'lib/solidus_content/providers/json.rb', line 21 def entry_fields [] end |
.entry_type_fields ⇒ Object
17 18 19 |
# File 'lib/solidus_content/providers/json.rb', line 17 def entry_type_fields %i[path] end |