Parent

Included Modules

Files

Class Index [+]

Quicksearch

SOAP::SOAPStruct

Compound datatypes.

Public Class Methods

decode(elename, type) click to toggle source
     # File lib/soap/baseData.rb, line 629
629:   def self.decode(elename, type)
630:     s = SOAPStruct.new(type)
631:     s.elename = elename
632:     s
633:   end
new(type = nil) click to toggle source
     # File lib/soap/baseData.rb, line 534
534:   def initialize(type = nil)
535:     super()
536:     @type = type || XSD::QName::EMPTY
537:     @array = []
538:     @data = []
539:   end

Public Instance Methods

[](idx) click to toggle source
     # File lib/soap/baseData.rb, line 558
558:   def [](idx)
559:     if idx.is_a?(Range)
560:       @data[idx]
561:     elsif idx.is_a?(Integer)
562:       if (idx > @array.size)
563:         raise ArrayIndexOutOfBoundsError.new('In ' << @type.name)
564:       end
565:       @data[idx]
566:     else
567:       if @array.include?(idx)
568:         @data[@array.index(idx)]
569:       else
570:         nil
571:       end
572:     end
573:   end
[]=(idx, data) click to toggle source
     # File lib/soap/baseData.rb, line 575
575:   def []=(idx, data)
576:     if @array.include?(idx)
577:       data.parent = self if data.respond_to?(:parent=)
578:       @data[@array.index(idx)] = data
579:     else
580:       add(idx, data)
581:     end
582:   end
add(name, value) click to toggle source
     # File lib/soap/baseData.rb, line 549
549:   def add(name, value)
550:     value = SOAPNil.new if value.nil?
551:     @array.push(name)
552:     value.elename = value.elename.dup_name(name)
553:     @data.push(value)
554:     value.parent = self if value.respond_to?(:parent=)
555:     value
556:   end
each() click to toggle source
     # File lib/soap/baseData.rb, line 615
615:   def each
616:     idx = 0
617:     while idx < @array.length
618:       yield(@array[idx], @data[idx])
619:       idx += 1
620:     end
621:   end
have_member() click to toggle source
     # File lib/soap/baseData.rb, line 592
592:   def have_member
593:     !@array.empty?
594:   end
key?(name) click to toggle source
     # File lib/soap/baseData.rb, line 584
584:   def key?(name)
585:     @array.include?(name)
586:   end
members() click to toggle source
     # File lib/soap/baseData.rb, line 588
588:   def members
589:     @array
590:   end
replace() click to toggle source
     # File lib/soap/baseData.rb, line 623
623:   def replace
624:     members.each do |member|
625:       self[member] = yield(self[member])
626:     end
627:   end
to_obj() click to toggle source
     # File lib/soap/baseData.rb, line 596
596:   def to_obj
597:     hash = {}
598:     proptype = {}
599:     each do |k, v|
600:       value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s
601:       case proptype[k]
602:       when :single
603:         hash[k] = [hash[k], value]
604:         proptype[k] = :multi
605:       when :multi
606:         hash[k] << value
607:       else
608:         hash[k] = value
609:         proptype[k] = :single
610:       end
611:     end
612:     hash
613:   end
to_s() click to toggle source
     # File lib/soap/baseData.rb, line 541
541:   def to_s
542:     str = ''
543:     self.each do |key, data|
544:       str << "#{key}: #{data}\n"
545:     end
546:     str
547:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.