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

The base class of XSD datatypes.

Methods

_set   _to_s   check_lexical_format   init   new   screen_data   set   to_s  

Included Modules

XSD

Constants

Type = QName.new(Namespace, AnySimpleTypeLiteral)

Attributes

data  [R]  @data represents canonical space (ex. Integer: 123).
is_nil  [RW]  @is_nil represents this data is nil or not.

Public Class methods

[Source]

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

Public Instance methods

true or raise

[Source]

     # 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).

[Source]

     # 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

to_s creates a string which follows lexical space (ex. String: "123").

[Source]

     # File lib/xsd/datatypes.rb, line 145
145:   def to_s()
146:     if @is_nil
147:       ""
148:     else
149:       _to_s
150:     end
151:   end

Private Instance methods

[Source]

     # File lib/xsd/datatypes.rb, line 165
165:   def _set(value)
166:     @data = value
167:   end

[Source]

     # File lib/xsd/datatypes.rb, line 169
169:   def _to_s
170:     @data.to_s
171:   end

[Source]

     # 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

[Source]

     # File lib/xsd/datatypes.rb, line 161
161:   def screen_data(value)
162:     value
163:   end

[Validate]