class RD::DocumentStructure
DocumentStructure
defines and restricts structure of document tree. it consists of ElementRelationship
Constants
- LOOSE
- RD
Public Class Methods
Public Instance Methods
Source
# File lib/rd/document-struct.rb, line 10 def add_relationships(*relations) @relationships += relations end
Source
# File lib/rd/document-struct.rb, line 14 def define_relationship(parent, child) add_relationships(ElementRelationship.new(parent, child)) end
Source
# File lib/rd/document-struct.rb, line 18 def each_relationship @relationships.each do |i| yield(i) end end
Source
# File lib/rd/document-struct.rb, line 24 def is_valid?(parent, child) each_relationship do |i| return true if i.match?(parent, child) end false end