Class XSD::XSDQName
In: lib/xsd/datatypes.rb
Parent: XSDAnySimpleType

Methods

_set   _to_s   new   screen_data  

Constants

Type = QName.new(Namespace, QNameLiteral)

Public Class methods

[Source]

     # File lib/xsd/datatypes.rb, line 947
947:   def initialize(value = nil)
948:     init(Type, value)
949:   end

Private Instance methods

[Source]

     # File lib/xsd/datatypes.rb, line 963
963:   def _set(data)
964:     if data.nil?
965:       @prefix = @localpart = @data = nil
966:       return
967:     end
968:     @prefix, @localpart = data
969:     @data = _to_s
970:     @data.freeze
971:   end

[Source]

     # File lib/xsd/datatypes.rb, line 973
973:   def _to_s
974:     if @prefix
975:       "#{ @prefix }:#{ @localpart }"
976:     else
977:       "#{ @localpart }"
978:     end
979:   end

[Source]

     # File lib/xsd/datatypes.rb, line 953
953:   def screen_data(value)
954:     /^(?:([^:]+):)?([^:]+)$/ =~ value.to_s.strip
955:     unless Regexp.last_match
956:       raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
957:     end
958:     prefix = $1
959:     localpart = $2
960:     [prefix, localpart]
961:   end

[Validate]