class OpenEHR::AM::Archetype::ConstraintModel::ArchetypeConstraint

Attributes

parent[RW]
path[R]

Public Class Methods

new(args = { }) click to toggle source
# File lib/openehr/am/archetype/constraint_model.rb, line 9
def initialize(args = { })
  self.path = args[:path] if args[:path]
  self.parent = args[:parent]
end

Public Instance Methods

congruent?() click to toggle source
# File lib/openehr/am/archetype/constraint_model.rb, line 25
def congruent?
  path.index(@parent.path) == 0
end
Also aliased as: is_congruent?
has_path?(search_path) click to toggle source
# File lib/openehr/am/archetype/constraint_model.rb, line 21
def has_path?(search_path)
  path.include?(search_path)
end
is_congruent?()
Alias for: congruent?
node_conforms_to?(other) click to toggle source
# File lib/openehr/am/archetype/constraint_model.rb, line 31
def node_conforms_to?(other)
  path.index(other.path) == 0
end
path=(path) click to toggle source
# File lib/openehr/am/archetype/constraint_model.rb, line 14
def path=(path)
  if path.nil?
    raise ArgumentError, 'path is mandatory'
  end
  @path = path
end

Protected Instance Methods

parent_path() click to toggle source
# File lib/openehr/am/archetype/constraint_model.rb, line 37
def parent_path
  parent ? parent.path : ''
end