Class: WSDL::XMLSchema::SimpleRestriction
- Defined in:
- lib/wsdl/xmlSchema/simpleRestriction.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#enumeration ⇒ Object
readonly
Returns the value of attribute enumeration.
-
#length ⇒ Object
Returns the value of attribute length.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
Attributes inherited from Info
Instance Method Summary collapse
-
#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.
23 24 25 26 27 28 29 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 23 def initialize super @base = nil @enumeration = [] # NamedElements? @length = nil @pattern = nil end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base
18 19 20 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 18 def base @base end |
#enumeration ⇒ Object (readonly)
Returns the value of attribute enumeration
19 20 21 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 19 def enumeration @enumeration end |
#length ⇒ Object
Returns the value of attribute length
20 21 22 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 20 def length @length end |
#pattern ⇒ Object
Returns the value of attribute pattern
21 22 23 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 21 def pattern @pattern end |
Instance Method Details
#parse_attr(attr, value) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 49 def parse_attr(attr, value) case attr when BaseAttrName @base = value end end |
#parse_element(element) ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 38 def parse_element(element) case element when EnumerationName Enumeration.new # just a parsing handler when LengthName Length.new # just a parsing handler when PatternName Pattern.new # just a parsing handler end end |
#valid?(value) ⇒ Boolean
31 32 33 34 35 36 |
# File 'lib/wsdl/xmlSchema/simpleRestriction.rb', line 31 def valid?(value) return false unless check_restriction(value) return false unless check_length(value) return false unless check_pattern(value) true end |