lib/open_ehr/rm/support/identification.rb in open_ehr-0.9.5 vs lib/open_ehr/rm/support/identification.rb in open_ehr-1.0.0
- old
+ new
@@ -16,12 +16,12 @@
def value=(value)
raise ArgumentError, "empty value" if value.nil? or value.empty?
@value = value
end
- def ==(object_id)
- self.value == object_id.value
+ def ==(oid)
+ self.value == oid.value
end
end # of ObjectID
class ObjectRef
attr_reader :namespace, :type, :id
@@ -237,34 +237,38 @@
return !@extension.empty?
end
end
class ObjectVersionID < UIDBasedID
- attr_reader :object_id, :creating_system_id, :version_tree_id
+ attr_reader :creating_system_id, :version_tree_id
def initialize(args= {})
- super(args)
+ super
end
def value=(value)
if /^(\S+)::(\S+)::((\d|\.)+)$/ =~ value
- self.object_id = UID.new(:value => $1)
+ self.objectid = UID.new(:value => $1)
self.creating_system_id = UID.new(:value => $2)
self.version_tree_id = VersionTreeID.new(:value => $3)
else
raise ArgumentError, 'invalid format'
end
end
def value
- return @object_id.value + '::' +
+ return @oid.value + '::' +
@creating_system_id.value + '::' +
@version_tree_id.value
end
- def object_id=(object_id)
- raise ArgumentError, 'object_id is mandatory' if object_id.nil?
- @object_id = object_id
+ def objectid
+ return @oid
+ end
+
+ def objectid=(oid)
+ raise ArgumentError, 'objectid is mandatory' if oid.nil?
+ @oid = oid
end
def creating_system_id=(creating_system_id)
if creating_system_id.nil?
raise ArgumentError, 'creating_system_id is mandatory'