Class: SOAP::XSD
- Inherits:
-
Object
- Object
- SOAP::XSD
- Includes:
- Comparable
- Defined in:
- lib/wsdl-reader/xsd.rb,
lib/wsdl-reader/xsd/convert.rb,
lib/wsdl-reader/xsd/element.rb,
lib/wsdl-reader/xsd/sequence.rb,
lib/wsdl-reader/xsd/simpletype.rb,
lib/wsdl-reader/xsd/complextype.rb,
lib/wsdl-reader/xsd/enumeration.rb,
lib/wsdl-reader/xsd/restriction.rb
Defined Under Namespace
Classes: ComplexType, Convert, Element, Enumeration, Restriction, Sequence, SimpleType
Constant Summary collapse
- ANY_SIMPLE_TYPE =
%w(duration dateTime time date gYearMonth gYear gMonthDay gDay gMonth boolean base64Binary hexBinary float double anyURI QName NOTATION string normalizedString token language Name NMTOKEN NCName NMTOKENS ID IDREF ENTITY IDREFS ENTITIES decimal integer nonPositiveInteger long nonNegativeInteger negativeInteger int unsignedLong positiveInteger short unsignedInt byte unsignedShort unsignedByte)
Instance Attribute Summary collapse
-
#complexType ⇒ Object
readonly
Returns the value of attribute complexType.
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
-
#simpleTypes ⇒ Object
readonly
Returns the value of attribute simpleTypes.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #[](name) ⇒ Object
- #add_schema(types) ⇒ Object
- #any_defined_type ⇒ Object
-
#initialize ⇒ XSD
constructor
A new instance of XSD.
Constructor Details
Instance Attribute Details
#complexType ⇒ Object (readonly)
Returns the value of attribute complexType.
17 18 19 |
# File 'lib/wsdl-reader/xsd.rb', line 17 def complexType @complexType end |
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
15 16 17 |
# File 'lib/wsdl-reader/xsd.rb', line 15 def elements @elements end |
#simpleTypes ⇒ Object (readonly)
Returns the value of attribute simpleTypes.
16 17 18 |
# File 'lib/wsdl-reader/xsd.rb', line 16 def simpleTypes @simpleTypes end |
Class Method Details
.displayBuiltinType(name, args, min = 1, max = 1) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/wsdl-reader/xsd.rb', line 53 def self.displayBuiltinType(name, args, min = 1, max = 1) r = "" if args.keys.include?(name.to_sym) args[name.to_sym] = [args[name.to_sym]] unless args[name.to_sym].class == Array if args[name.to_sym].size < min or args[name.to_sym].size > max raise SOAP::LCArgumentError, "Wrong number or values for parameter `#{name}'" end args[name.to_sym].each { |v| r << "<#{name}>#{v}</#{name}>\n" } elsif min > 0 raise SOAP::LCArgumentError, "Missing parameter `#{name}'" if min > 0 end return r end |
Instance Method Details
#<=>(other) ⇒ Object
32 33 34 |
# File 'lib/wsdl-reader/xsd.rb', line 32 def <=>(other) @types <=> other.instance_variable_get(:@types) end |
#[](name) ⇒ Object
49 50 51 |
# File 'lib/wsdl-reader/xsd.rb', line 49 def [](name) @types[name] end |
#add_schema(types) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/wsdl-reader/xsd.rb', line 36 def add_schema(types) # Process all schema types.children.find_all { |e| e.class == REXML::Element }.each { |schema| schema.find_all { |e| e.class == REXML::Element }.each { |type| processType type } } end |
#any_defined_type ⇒ Object
45 46 47 |
# File 'lib/wsdl-reader/xsd.rb', line 45 def any_defined_type @types.keys end |