class XSD::XSDHexBinary

Constants

Type

Public Class Methods

new(value = nil) click to toggle source

String in Ruby could be a binary.

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

Public Instance Methods

set_encoded(value) click to toggle source
# File lib/xsd/datatypes.rb, line 894
def set_encoded(value)
  if /^[0-9a-fA-F]*$/ !~ value
    raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
  end
  @data = String.new(value).strip
  @is_nil = false
end
string() click to toggle source
# File lib/xsd/datatypes.rb, line 902
def string
  [@data].pack("H*")
end

Private Instance Methods

screen_data(value) click to toggle source
# File lib/xsd/datatypes.rb, line 908
def screen_data(value)
  value.unpack("H*")[0].tr('a-f', 'A-F')
end