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

Methods

new   screen_data  

Constants

Type = QName.new(Namespace, BooleanLiteral)

Public Class methods

[Source]

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

Private Instance methods

[Source]

     # File lib/xsd/datatypes.rb, line 213
213:   def screen_data(value)
214:     if value.is_a?(String)
215:       str = value.strip
216:       if str == 'true' || str == '1'
217:         true
218:       elsif str == 'false' || str == '0'
219:         false
220:       else
221:         raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
222:       end
223:     else
224:       value ? true : false
225:     end
226:   end

[Validate]