Class: Duxml::NullChildPatternClass
- Inherits:
-
PatternClass
- Object
- PatternClass
- Duxml::NullChildPatternClass
- Includes:
- ChildPattern
- Defined in:
- lib/duxml/meta/grammar/pattern/child_pattern.rb
Overview
null child patterns represent and parent child relationship where the child is required by the Grammar but the element is missing that child
Instance Attribute Summary collapse
-
#missing_child ⇒ Object
(also: #child)
readonly
Returns the value of attribute missing_child.
Attributes inherited from PatternClass
Attributes included from Duxml
Attributes included from Saxer
Instance Method Summary collapse
-
#description ⇒ String
Description of this child pattern.
-
#index ⇒ -1
Class must respond to #index; only NullChildPatternClass is allowed to have a negative index.
-
#initialize(_subject, _missing_child) ⇒ NullChildPatternClass
constructor
A new instance of NullChildPatternClass.
- #relationship ⇒ Object
Methods included from Pattern
#<=>, #abstract?, #concrete?, #name, #object, #simple_name, #xml
Methods included from Duxml
Methods included from Saxer
Constructor Details
#initialize(_subject, _missing_child) ⇒ NullChildPatternClass
Returns a new instance of NullChildPatternClass.
30 31 32 33 |
# File 'lib/duxml/meta/grammar/pattern/child_pattern.rb', line 30 def initialize(_subject, _missing_child) @missing_child = _missing_child super _subject end |
Instance Attribute Details
#missing_child ⇒ Object (readonly) Also known as: child
Returns the value of attribute missing_child.
49 50 51 |
# File 'lib/duxml/meta/grammar/pattern/child_pattern.rb', line 49 def missing_child @missing_child end |
Instance Method Details
#description ⇒ String
Returns description of this child pattern.
45 46 47 |
# File 'lib/duxml/meta/grammar/pattern/child_pattern.rb', line 45 def description "#{subject.description} #{relationship} <#{child}>" end |
#index ⇒ -1
Returns class must respond to #index; only NullChildPatternClass is allowed to have a negative index.
36 37 38 |
# File 'lib/duxml/meta/grammar/pattern/child_pattern.rb', line 36 def index -1 end |
#relationship ⇒ Object
40 41 42 |
# File 'lib/duxml/meta/grammar/pattern/child_pattern.rb', line 40 def relationship 'missing child' end |