Class: Sinicum::Templating::DialogResolver
- Inherits:
-
Object
- Object
- Sinicum::Templating::DialogResolver
- Includes:
- Jcr::ApiClient, TemplatingUtils
- Defined in:
- lib/sinicum/templating/dialog_resolver.rb
Overview
Private: Provides information about Magnolia dialogs.
Instance Method Summary collapse
Methods included from Jcr::ApiClient
Methods included from Logger
Instance Method Details
#dialog_for_node(node) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sinicum/templating/dialog_resolver.rb', line 8 def dialog_for_node(node) result = nil template = split_template_path(node.mgnl_template) path = "/_templating/dialogs/#{template[:type]}" \ "/#{template[:module]}/#{template[:name]}" response = api_get(path) if response.ok? begin json = MultiJson.load(response.body) result = json["dialog"] rescue # nothing end end result end |