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

Methods

new   screen_data   set_encoded   string  

Constants

Type = QName.new(Namespace, HexBinaryLiteral)

Public Class methods

String in Ruby could be a binary.

[Source]

     # File lib/xsd/datatypes.rb, line 876
876:   def initialize(value = nil)
877:     init(Type, value)
878:   end

Public Instance methods

[Source]

     # File lib/xsd/datatypes.rb, line 880
880:   def set_encoded(value)
881:     if /^[0-9a-fA-F]*$/ !~ value
882:       raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
883:     end
884:     @data = String.new(value).strip
885:     @is_nil = false
886:   end

[Source]

     # File lib/xsd/datatypes.rb, line 888
888:   def string
889:     [@data].pack("H*")
890:   end

Private Instance methods

[Source]

     # File lib/xsd/datatypes.rb, line 894
894:   def screen_data(value)
895:     value.unpack("H*")[0].tr('a-f', 'A-F')
896:   end

[Validate]