Class | XSD::XSDAnySimpleType |
In: |
lib/xsd/datatypes.rb
|
Parent: | NSDBase |
The base class of XSD datatypes.
Type | = | QName.new(Namespace, AnySimpleTypeLiteral) |
data | [R] | @data represents canonical space (ex. Integer: 123). |
is_nil | [RW] | @is_nil represents this data is nil or not. |
# File lib/xsd/datatypes.rb, line 121 121: def initialize(value = nil) 122: init(Type, value) 123: end
true or raise
# File lib/xsd/datatypes.rb, line 126 126: def check_lexical_format(value) 127: screen_data(value) 128: true 129: end
set accepts a string which follows lexical space (ex. String: "+123"), or an object which follows canonical space (ex. Integer: 123).
# File lib/xsd/datatypes.rb, line 133 133: def set(value) 134: if value.nil? 135: @is_nil = true 136: @data = nil 137: _set(nil) 138: else 139: @is_nil = false 140: _set(screen_data(value)) 141: end 142: end
# File lib/xsd/datatypes.rb, line 155 155: def init(type, value) 156: super(type) 157: set(value) 158: end
raises ValueSpaceError if check failed
# File lib/xsd/datatypes.rb, line 161 161: def screen_data(value) 162: value 163: end