Class: WSDL::XMLSchema::SimpleRestriction
- Defined in:
- lib/wsdl/xmlSchema/simpleRestriction.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#enumeration ⇒ Object
readonly
Returns the value of attribute enumeration.
-
#fixed ⇒ Object
readonly
Returns the value of attribute fixed.
-
#fractiondigits ⇒ Object
Returns the value of attribute fractiondigits.
-
#length ⇒ Object
Returns the value of attribute length.
-
#maxexclusive ⇒ Object
Returns the value of attribute maxexclusive.
-
#maxinclusive ⇒ Object
Returns the value of attribute maxinclusive.
-
#maxlength ⇒ Object
Returns the value of attribute maxlength.
-
#minexclusive ⇒ Object
Returns the value of attribute minexclusive.
-
#mininclusive ⇒ Object
Returns the value of attribute mininclusive.
-
#minlength ⇒ Object
Returns the value of attribute minlength.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#totaldigits ⇒ Object
Returns the value of attribute totaldigits.
-
#whitespace ⇒ Object
Returns the value of attribute whitespace.
Attributes inherited from Info
Instance Method Summary collapse
- #enumeration? ⇒ Boolean
-
#initialize ⇒ SimpleRestriction
constructor
A new instance of SimpleRestriction.
- #parse_attr(attr, value) ⇒ Object
- #parse_element(element) ⇒ Object
- #valid?(value) ⇒ Boolean
Methods inherited from Info
Constructor Details
#initialize ⇒ SimpleRestriction
Returns a new instance of SimpleRestriction.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 35 def initialize super @base = nil @enumeration = [] # NamedElements? @length = nil @maxlength = nil @minlength = nil @pattern = nil @fixed = {} @attributes = XSD::NamedElements.new end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes
33 34 35 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 33 def attributes @attributes end |
#base ⇒ Object (readonly)
Returns the value of attribute base
19 20 21 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 19 def base @base end |
#enumeration ⇒ Object (readonly)
Returns the value of attribute enumeration
24 25 26 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 24 def enumeration @enumeration end |
#fixed ⇒ Object (readonly)
Returns the value of attribute fixed
32 33 34 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 32 def fixed @fixed end |
#fractiondigits ⇒ Object
Returns the value of attribute fractiondigits
31 32 33 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 31 def fractiondigits @fractiondigits end |
#length ⇒ Object
Returns the value of attribute length
20 21 22 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 20 def length @length end |
#maxexclusive ⇒ Object
Returns the value of attribute maxexclusive
27 28 29 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 27 def maxexclusive @maxexclusive end |
#maxinclusive ⇒ Object
Returns the value of attribute maxinclusive
26 27 28 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 26 def maxinclusive @maxinclusive end |
#maxlength ⇒ Object
Returns the value of attribute maxlength
22 23 24 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 22 def maxlength @maxlength end |
#minexclusive ⇒ Object
Returns the value of attribute minexclusive
28 29 30 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 28 def minexclusive @minexclusive end |
#mininclusive ⇒ Object
Returns the value of attribute mininclusive
29 30 31 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 29 def mininclusive @mininclusive end |
#minlength ⇒ Object
Returns the value of attribute minlength
21 22 23 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 21 def minlength @minlength end |
#pattern ⇒ Object
Returns the value of attribute pattern
23 24 25 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 23 def pattern @pattern end |
#totaldigits ⇒ Object
Returns the value of attribute totaldigits
30 31 32 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 30 def totaldigits @totaldigits end |
#whitespace ⇒ Object
Returns the value of attribute whitespace
25 26 27 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 25 def whitespace @whitespace end |
Instance Method Details
#enumeration? ⇒ Boolean
56 57 58 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 56 def enumeration? !@enumeration.empty? end |
#parse_attr(attr, value) ⇒ Object
101 102 103 104 105 106 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 101 def parse_attr(attr, value) case attr when BaseAttrName @base = value end end |
#parse_element(element) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 60 def parse_element(element) case element when LengthName Length.new when MinLengthName MinLength.new when MaxLengthName MaxLength.new when PatternName Pattern.new when EnumerationName Enumeration.new when WhiteSpaceName WhiteSpace.new when MaxInclusiveName MaxInclusive.new when MaxExclusiveName MaxExclusive.new when MinExclusiveName MinExclusive.new when MinInclusiveName MinInclusive.new when TotalDigitsName TotalDigits.new when FractionDigitsName FractionDigits.new when AttributeName o = Attribute.new @attributes << o o when AttributeGroupName o = AttributeGroup.new @attributes << o o when AnyAttributeName o = AnyAttribute.new @attributes << o o end end |
#valid?(value) ⇒ Boolean
47 48 49 50 51 52 53 54 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 47 def valid?(value) return false unless check_restriction(value) return false unless check_length(value) return false unless check_maxlength(value) return false unless check_minlength(value) return false unless check_pattern(value) true end |