Class: Nokogiri::XML::Schematron::Nodes::Validations::Inclusion

Inherits:
Base
  • Object
show all
Defined in:
lib/nokogiri/xml/schematron/nodes/validations/inclusion.rb

Overview

The abstract syntax tree node that uses the contains(haystack, needle) XPath function, where haystack and needle are strings, to test if the @context XML attribute is included in an array of available items.

For the supplied array of available items

["a", "b", "c"]

and context

"/x/y/z/text()"

this abstract syntax tree node is equivalent to the XPath:

"contains('_a_ _b_ _c_', concat('_', /x/y/z/text(), '_'))"

Instance Attribute Summary collapse

Attributes inherited from Base

#child_node_by_context, #context

Attributes inherited from Base

#children, #options, #parent

Method Summary

Methods inherited from Base

#initialize, #permit, #reject, #require, #validates_exclusion_of, #validates_inclusion_of, #validates_numericality_of

Methods inherited from Base

attribute, element, #initialize, #to_builder

Constructor Details

This class inherits a constructor from Nokogiri::XML::Schematron::Nodes::Base

Instance Attribute Details

#inArray<String>

Returns the array of available items.

Returns:

  • (Array<String>)

    the array of available items.



29
# File 'lib/nokogiri/xml/schematron/nodes/validations/inclusion.rb', line 29

attribute :in