Method: Innate::Node#resolve

Defined in:
lib/innate/node.rb

#resolve(path, options = {}) ⇒ nil, Action

Let’s get down to business, first check if we got any wishes regarding the representation from the client, otherwise we will assume he wants html.

Parameters:

  • path (String)
  • options (Hash) (defaults to: {})

Returns:

See Also:

  • Node::update_method_arities Node::find_action

Author:

  • manveru



372
373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/innate/node.rb', line 372

def resolve(path, options = {})
  name, wish, engine = find_provide(path)
  node = (respond_to?(:ancestors) && respond_to?(:new)) ? self : self.class
  action = Action.create(:node => node, :wish => wish, :engine => engine, :path => path, :options => options)
  action.options.key?(:needs_method) || action.options[:needs_method] = node.needs_method?

  if content_type = node.ancestral_trait["#{wish}_content_type"]
    action.options[:content_type] = content_type
  end

  node.update_method_arities
  node.update_template_mappings
  node.fill_action(action, name)
end