Changeset 275


Ignore:
Timestamp:
Sep 17, 2009, 3:56:00 PM (10 years ago)
Author:
KOBAYASHI, Shinji
Message:

object_ref test/unit move to rspec

Location:
ruby/branches/0.5
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/0.5/lib/open_ehr/rm/support/identification.rb

    r274 r275  
    2626          attr_reader :namespace, :type, :id
    2727
    28           def initialize(namespace, type, id)
    29             self.namespace = namespace
    30             self.type = type
    31             self.id = id
     28          def initialize(args = {})
     29            self.namespace = args[:namespace]
     30            self.type = args[:type]
     31            self.id = args[:id]
    3232          end
    3333
    3434          def namespace=(namespace)
    35             raise ArgumentError if namespace.nil? or namespace.empty? or !(/([a-z]|[A-Z]).*/ =~ namespace) # error original is =~ #([a-z][A-Z])([a-z]|[A-Z]|\s|[v0-9]|[_-\:\/\&\+\?])*/
     35            if namespace.nil? or namespace.empty? or
     36                !(/^[a-zA-Z][a-zA-Z0-9_\-\:\/\&\+\?]*$/ =~ namespace)
     37              raise ArgumentError
     38            end
    3639            @namespace = namespace
    3740          end
Note: See TracChangeset for help on using the changeset viewer.