Module: Sevgi::Standard::Model::CDataOrSomeElements Private

Defined in:
lib/sevgi/standard/model.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.

Validates elements that allow character data or selected child elements.

Instance Method Summary collapse

Instance Method Details

#apply(cdata:, elements:) ⇒ nil

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.

Applies this content model.

Parameters:

  • cdata (String, nil)

    character data content

  • elements (Array<Symbol>)

    child element names

Returns:

  • (nil)

Raises:



29
30
31
32
33
34
# File 'lib/sevgi/standard/model.rb', line 29

def apply(cdata:, elements:)
  _cdata = cdata

  unallowed = elements - spec[:elements]
  UnallowedElementsError.(element, unallowed) unless unallowed.empty?
end