Module: Teek::UI::TabValidator Private

Defined in:
lib/teek/ui/tab_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 tab's own contract: it must be declared directly inside a ui.tabs. Only reachable via direct Node/Document manipulation, since WidgetDSL#tab already refuses to run outside a ui.tabs block - the same defense-in-depth GridValidator.check_stray_cell does for grid. Composed into WidgetValidators via :tab's own WidgetType#validator (see widget_types/tab.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 :tab 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/tab_validator.rb', line 22

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

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