Parent

Files

Class Index [+]

Quicksearch

WSDL::XMLSchema::SimpleRestriction

Attributes

base[R]
length[RW]
minlength[RW]
maxlength[RW]
pattern[RW]
enumeration[R]
whitespace[RW]
maxinclusive[RW]
maxexlusive[RW]
minexlusive[RW]
mininclusive[RW]
totaldigits[RW]
fractiondigits[RW]
fixed[R]
attributes[R]

Public Class Methods

new() click to toggle source
    # File lib/wsdl/xmlSchema/simpleRestriction.rb, line 34
34:   def initialize
35:     super
36:     @base = nil
37:     @enumeration = []   # NamedElements?
38:     @length = nil
39:     @maxlength = nil
40:     @minlength = nil
41:     @pattern = nil
42:     @fixed = {}
43:     @attributes = XSD::NamedElements.new
44:   end

Public Instance Methods

enumeration?() click to toggle source
    # File lib/wsdl/xmlSchema/simpleRestriction.rb, line 55
55:   def enumeration?
56:     !@enumeration.empty?
57:   end
parse_attr(attr, value) click to toggle source
     # File lib/wsdl/xmlSchema/simpleRestriction.rb, line 100
100:   def parse_attr(attr, value)
101:     case attr
102:     when BaseAttrName
103:       @base = value
104:     end
105:   end
parse_element(element) click to toggle source
    # File lib/wsdl/xmlSchema/simpleRestriction.rb, line 59
59:   def parse_element(element)
60:     case element
61:     when LengthName
62:       Length.new
63:     when MinLengthName
64:       MinLength.new
65:     when MaxLengthName
66:       MaxLength.new
67:     when PatternName
68:       Pattern.new
69:     when EnumerationName
70:       Enumeration.new
71:     when WhiteSpaceName
72:       WhiteSpace.new
73:     when MaxInclusiveName
74:       MaxInclusive.new
75:     when MaxExclusiveName
76:       MaxExlusive.new
77:     when MinExclusiveName
78:       MinExlusive.new
79:     when MinInclusiveName
80:       MinInclusive.new
81:     when TotalDigitsName
82:       TotalDigits.new
83:     when FractionDigitsName
84:       FractionDigits.new
85:     when AttributeName
86:       o = Attribute.new
87:       @attributes << o
88:       o
89:     when AttributeGroupName
90:       o = AttributeGroup.new
91:       @attributes << o
92:       o
93:     when AnyAttributeName
94:       o = AnyAttribute.new
95:       @attributes << o
96:       o
97:     end
98:   end
valid?(value) click to toggle source
    # File lib/wsdl/xmlSchema/simpleRestriction.rb, line 46
46:   def valid?(value)
47:     return false unless check_restriction(value)
48:     return false unless check_length(value)
49:     return false unless check_maxlength(value)
50:     return false unless check_minlength(value)
51:     return false unless check_pattern(value)
52:     true
53:   end

Private Instance Methods

check_length(value) click to toggle source
     # File lib/wsdl/xmlSchema/simpleRestriction.rb, line 113
113:   def check_length(value)
114:     @length.nil? or value.size == @length
115:   end
check_maxlength(value) click to toggle source
     # File lib/wsdl/xmlSchema/simpleRestriction.rb, line 117
117:   def check_maxlength(value)
118:     @maxlength.nil? or value.size <= @maxlength
119:   end
check_minlength(value) click to toggle source
     # File lib/wsdl/xmlSchema/simpleRestriction.rb, line 121
121:   def check_minlength(value)
122:     @minlength.nil? or value.size >= @minlength
123:   end
check_pattern(value) click to toggle source
     # File lib/wsdl/xmlSchema/simpleRestriction.rb, line 125
125:   def check_pattern(value)
126:     @pattern.nil? or @pattern =~ value
127:   end
check_restriction(value) click to toggle source
     # File lib/wsdl/xmlSchema/simpleRestriction.rb, line 109
109:   def check_restriction(value)
110:     @enumeration.empty? or @enumeration.include?(value)
111:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.