Module: Teek::UI::PaneValidator Private

Defined in:
lib/teek/ui/pane_validator.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

A pane's own contract: it must be declared directly inside a ui.split. Only reachable via direct Node/Document manipulation, since WidgetDSL#pane already refuses to run outside a ui.split block - the same defense-in-depth TabValidator does for tabs. Composed into WidgetValidators via :pane's own WidgetType#validator (see widget_types/pane.rb).

Class Method Summary collapse

Class Method Details

.call(node, parent, document, errors) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • node (Node)

    a :pane node - WidgetValidators only dispatches here for that type

  • parent (Node, nil)
  • document (Document)
  • errors (Array<String>)

    appended to, never raised



22
23
24
25
26
27
# File 'lib/teek/ui/pane_validator.rb', line 22

def self.call(node, parent, document, errors)
  return if parent && parent.type == :split

  errors << "#{WidgetValidators.describe(node)} is a :pane but its parent " \
             "(#{WidgetValidators.describe(parent)}) isn't a ui.split"
end