Class: WSDL::XMLSchema::SimpleType
- Defined in:
- lib/wsdl/xmlSchema/simpleType.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#name ⇒ Object
Returns the value of attribute name.
-
#restriction ⇒ Object
readonly
Returns the value of attribute restriction.
-
#union ⇒ Object
readonly
Returns the value of attribute union.
Attributes inherited from Info
Instance Method Summary collapse
- #base ⇒ Object
- #check_lexical_format(value) ⇒ Object
-
#initialize(name = nil) ⇒ SimpleType
constructor
A new instance of SimpleType.
- #parse_attr(attr, value) ⇒ Object
- #parse_element(element) ⇒ Object
- #targetnamespace ⇒ Object
Methods inherited from Info
Constructor Details
#initialize(name = nil) ⇒ SimpleType
Returns a new instance of SimpleType.
44 45 46 47 48 49 50 |
# File 'lib/wsdl/xmlSchema/simpleType.rb', line 44 def initialize(name = nil) super() @name = name @restriction = nil @list = nil @union = nil end |
Instance Attribute Details
#list ⇒ Object (readonly)
Returns the value of attribute list.
21 22 23 |
# File 'lib/wsdl/xmlSchema/simpleType.rb', line 21 def list @list end |
#name ⇒ Object
Returns the value of attribute name.
19 20 21 |
# File 'lib/wsdl/xmlSchema/simpleType.rb', line 19 def name @name end |
#restriction ⇒ Object (readonly)
Returns the value of attribute restriction.
20 21 22 |
# File 'lib/wsdl/xmlSchema/simpleType.rb', line 20 def restriction @restriction end |
#union ⇒ Object (readonly)
Returns the value of attribute union.
22 23 24 |
# File 'lib/wsdl/xmlSchema/simpleType.rb', line 22 def union @union end |
Instance Method Details
#base ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/wsdl/xmlSchema/simpleType.rb', line 36 def base if @restriction @restriction.base else nil end end |
#check_lexical_format(value) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/wsdl/xmlSchema/simpleType.rb', line 24 def check_lexical_format(value) if @restriction check_restriction(value) elsif @list # TODO: check elsif @union # TODO: check else raise ArgumentError.new("incomplete simpleType") end end |
#parse_attr(attr, value) ⇒ Object
70 71 72 73 74 75 |
# File 'lib/wsdl/xmlSchema/simpleType.rb', line 70 def parse_attr(attr, value) case attr when NameAttrName @name = XSD::QName.new(targetnamespace, value.source) end end |
#parse_element(element) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/wsdl/xmlSchema/simpleType.rb', line 56 def parse_element(element) case element when RestrictionName @restriction = SimpleRestriction.new @restriction when ListName @list = List.new @list when UnionName @union = Union.new @union end end |
#targetnamespace ⇒ Object
52 53 54 |
# File 'lib/wsdl/xmlSchema/simpleType.rb', line 52 def targetnamespace parent.targetnamespace end |