Class XSD::XSDInteger
In: lib/xsd/datatypes.rb
Parent: XSDDecimal

Methods

Constants

Type = QName.new(Namespace, IntegerLiteral)
PositiveMinInclusive = 1

Public Class methods

[Source]

      # File lib/xsd/datatypes.rb, line 1006
1006:   def initialize(value = nil)
1007:     init(Type, value)
1008:   end

Private Instance methods

[Source]

      # File lib/xsd/datatypes.rb, line 1024
1024:   def _set(value)
1025:     @data = value
1026:   end

[Source]

      # File lib/xsd/datatypes.rb, line 1028
1028:   def _to_s()
1029:     @data.to_s
1030:   end

[Source]

      # File lib/xsd/datatypes.rb, line 1038
1038:   def maxinclusive
1039:     nil
1040:   end

[Source]

      # File lib/xsd/datatypes.rb, line 1042
1042:   def mininclusive
1043:     nil
1044:   end

[Source]

      # File lib/xsd/datatypes.rb, line 1047
1047:   def positive(v)
1048:     PositiveMinInclusive <= v
1049:   end

[Source]

      # File lib/xsd/datatypes.rb, line 1012
1012:   def screen_data_str(str)
1013:     begin
1014:       data = Integer(str)
1015:     rescue ArgumentError
1016:       raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
1017:     end
1018:     unless validate(data)
1019:       raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
1020:     end
1021:     data
1022:   end

[Source]

      # File lib/xsd/datatypes.rb, line 1032
1032:   def validate(v)
1033:     max = maxinclusive
1034:     min = mininclusive
1035:     (max.nil? or v <= max) and (min.nil? or v >= min)
1036:   end

[Validate]