Class: SOAP::XSD
- Inherits:
-
Object
- Object
- SOAP::XSD
- Defined in:
- lib/soap/lc/xsd.rb,
lib/soap/lc/xsd/convert.rb,
lib/soap/lc/xsd/element.rb,
lib/soap/lc/xsd/sequence.rb,
lib/soap/lc/xsd/simpletype.rb,
lib/soap/lc/xsd/complextype.rb,
lib/soap/lc/xsd/enumeration.rb,
lib/soap/lc/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
- #[](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.
16 17 18 |
# File 'lib/soap/lc/xsd.rb', line 16 def complexType @complexType end |
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
14 15 16 |
# File 'lib/soap/lc/xsd.rb', line 14 def elements @elements end |
#simpleTypes ⇒ Object (readonly)
Returns the value of attribute simpleTypes.
15 16 17 |
# File 'lib/soap/lc/xsd.rb', line 15 def simpleTypes @simpleTypes end |
Class Method Details
.displayBuiltinType(name, args, min = 1, max = 1) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/soap/lc/xsd.rb', line 48 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
#[](name) ⇒ Object
44 45 46 |
# File 'lib/soap/lc/xsd.rb', line 44 def []( name ) @types[name] end |
#add_schema(types) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/soap/lc/xsd.rb', line 31 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
40 41 42 |
# File 'lib/soap/lc/xsd.rb', line 40 def any_defined_type @types.keys end |