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

Attributes

parent[RW]
path[R]

Public Class Methods

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

Public Instance Methods

congruent?() click to toggle source
# File lib/open_ehr/am/archetype/constraint_model.rb, line 29
def congruent?
  if @path.index(@parent.path) == 0
    return true
  else
    return false
  end
end
Also aliased as: is_congruent?
has_path?(path) click to toggle source
# File lib/open_ehr/am/archetype/constraint_model.rb, line 25
def has_path?(path)
  return @path.include?(path)
end
is_congruent?()
Alias for: congruent?
node_conforms_to?(other) click to toggle source
# File lib/open_ehr/am/archetype/constraint_model.rb, line 39
def node_conforms_to?(other)
  if @path.index(other.path) == 0
    return true
  else
    return false
  end
end
path=(path) click to toggle source
# File lib/open_ehr/am/archetype/constraint_model.rb, line 18
def path=(path)
  if path.nil?
    raise ArgumentError, 'path is mandatory'
  end
  @path = path
end