Module: Duxml::ChildPattern
- Included in:
- ChildPatternClass, NullChildPatternClass
- Defined in:
- lib/duxml/meta/grammar/pattern/child_pattern.rb,
lib/duxml/meta/grammar/pattern/child_pattern.rb
Instance Method Summary collapse
-
#child ⇒ Element
(also: #object)
Child element.
-
#description ⇒ String
Description of this child pattern.
-
#relationship ⇒ String
Describes relationship between parent and child.
Instance Method Details
#child ⇒ Element Also known as: object
Returns child element.
56 57 58 |
# File 'lib/duxml/meta/grammar/pattern/child_pattern.rb', line 56 def child subject.nodes[index] end |
#description ⇒ String
Returns description of this child pattern.
68 69 70 |
# File 'lib/duxml/meta/grammar/pattern/child_pattern.rb', line 68 def description "#{subject.description}'s #{relationship} #{child.description}" end |
#relationship ⇒ String
Returns describes relationship between parent and child.
63 64 65 |
# File 'lib/duxml/meta/grammar/pattern/child_pattern.rb', line 63 def relationship "#{(index+1).ordinal_name} #{super}" end |