Class: XSD::XSDBase64Binary

Inherits:
XSDAnySimpleType show all
Defined in:
lib/xsd/datatypes.rb

Direct Known Subclasses

SOAP::SOAPBase64

Constant Summary collapse

Type =
QName.new(Namespace, Base64BinaryLiteral)

Constants included from XSD

AnySimpleTypeLiteral, AnySimpleTypeName, AnyTypeLiteral, AnyTypeName, AnyURILiteral, AttrNilName, AttrType, AttrTypeName, Base64BinaryLiteral, BooleanLiteral, ByteLiteral, DateLiteral, DateTimeLiteral, DecimalLiteral, DoubleLiteral, DurationLiteral, FloatLiteral, GDayLiteral, GMonthDayLiteral, GMonthLiteral, GYearLiteral, GYearMonthLiteral, HexBinaryLiteral, InstanceNamespace, IntLiteral, IntegerLiteral, LongLiteral, Namespace, NegativeIntegerLiteral, NilLiteral, NilValue, NonNegativeIntegerLiteral, NonPositiveIntegerLiteral, NormalizedStringLiteral, PositiveIntegerLiteral, QNameLiteral, ShortLiteral, StringLiteral, TimeLiteral, UnsignedByteLiteral, UnsignedIntLiteral, UnsignedLongLiteral, UnsignedShortLiteral

Instance Attribute Summary

Attributes inherited from XSDAnySimpleType

#data, #is_nil

Attributes inherited from NSDBase

#type

Instance Method Summary collapse

Methods inherited from XSDAnySimpleType

#check_lexical_format, #set, #to_s

Methods inherited from NSDBase

inherited, #init, types

Constructor Details

#initialize(value = nil) ⇒ XSDBase64Binary

String in Ruby could be a binary.



916
917
918
# File 'lib/xsd/datatypes.rb', line 916

def initialize(value = nil)
  init(Type, value)
end

Instance Method Details

#set_encoded(value) ⇒ Object



920
921
922
923
924
925
926
# File 'lib/xsd/datatypes.rb', line 920

def set_encoded(value)
  if /^[A-Za-z0-9+\/=]*$/ !~ value
    raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.")
  end
  @data = String.new(value).strip
  @is_nil = false
end

#stringObject



928
929
930
# File 'lib/xsd/datatypes.rb', line 928

def string
  @data.unpack("m")[0]
end