Class: XSD::XSDHexBinary
- Inherits:
-
XSDAnySimpleType
- Object
- NSDBase
- XSDAnySimpleType
- XSD::XSDHexBinary
- Defined in:
- lib/action_web_service/xsd/datatypes.rb
Direct Known Subclasses
Constant Summary collapse
- Type =
QName.new(Namespace, HexBinaryLiteral)
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
Attributes inherited from NSDBase
Instance Method Summary collapse
-
#initialize(value = nil) ⇒ XSDHexBinary
constructor
String in Ruby could be a binary.
- #set_encoded(value) ⇒ Object
- #string ⇒ Object
Methods inherited from XSDAnySimpleType
#check_lexical_format, #set, #to_s
Methods inherited from NSDBase
Constructor Details
#initialize(value = nil) ⇒ XSDHexBinary
String in Ruby could be a binary.
876 877 878 |
# File 'lib/action_web_service/xsd/datatypes.rb', line 876 def initialize(value = nil) init(Type, value) end |
Instance Method Details
#set_encoded(value) ⇒ Object
880 881 882 883 884 885 886 |
# File 'lib/action_web_service/xsd/datatypes.rb', line 880 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 ⇒ Object
888 889 890 |
# File 'lib/action_web_service/xsd/datatypes.rb', line 888 def string [@data].pack("H*") end |