Class: RD::ElementRelationship
- Inherits:
-
Object
- Object
- RD::ElementRelationship
- Defined in:
- lib/rd/document-struct.rb
Overview
ElementRelationship is knowledge about parent-children relationship between Elements.
Instance Attribute Summary collapse
-
#child ⇒ Object
readonly
Returns the value of attribute child.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(parent, child) ⇒ ElementRelationship
constructor
A new instance of ElementRelationship.
- #match?(parent, child) ⇒ Boolean
Constructor Details
#initialize(parent, child) ⇒ ElementRelationship
Returns a new instance of ElementRelationship.
37 38 39 40 |
# File 'lib/rd/document-struct.rb', line 37 def initialize(parent, child) @parent = parent @child = child end |
Instance Attribute Details
#child ⇒ Object (readonly)
Returns the value of attribute child.
35 36 37 |
# File 'lib/rd/document-struct.rb', line 35 def child @child end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
35 36 37 |
# File 'lib/rd/document-struct.rb', line 35 def parent @parent end |
Instance Method Details
#match?(parent, child) ⇒ Boolean
42 43 44 |
# File 'lib/rd/document-struct.rb', line 42 def match?(parent, child) parent.is_a? @parent and child.is_a? @child end |