XmlList

Parent

Namespace

Generated with Razzle Dazzle Redfish.
[Validate]

XmlList

Public Class Methods

__new( xd=[], to=nil, tp=nil ) click to toggle source

Alias for new

new( xd=[], to=nil, tp=nil ) click to toggle source

(Not documented)

# File lib/r4x/e4x.rb, line 179
    def new( xd=[], to=nil, tp=nil )
      case xd
      when XmlList
        xd
      else
        __new( xd, to, tp )
      end
    end
Also aliased as: __new
new( xd=[], to=nil, tp=nil ) click to toggle source

(Not documented)

# File lib/r4x/e4x.rb, line 189
  def initialize( xd=[], to=nil, tp=nil )
    @self = XmlListDelegate.new(self)
    case xd
    when []
      @list = []
      @target_object = to
      @target_property = tp
    when Xml
      @list = [xd]
      @target_object = xd.self.parent
      @target_property = xd.self.name
    else
      xd = REXML::Document.new(%{<_>#{xd}</_>}).root
      a = []; xd.each{ |n| a << Xml.new(n) }
      @list = a
      @target_object = nil
      @target_property = nil
    end
  end

Public Instance Methods

*() click to toggle source

XPath for all elements.

# File lib/r4x/e4x.rb, line 241
  def * ; @self.get('*') ; end
<<( n ) click to toggle source

Shortcut for add.

# File lib/r4x/e4x.rb, line 236
  def <<( n )
    @self.add( n )
  end
[]( v ) click to toggle source

(Not documented)

# File lib/r4x/e4x.rb, line 246
  def []( v )
    @self.get( v )
  end
[]=( prop, v ) click to toggle source

(Not documented)

# File lib/r4x/e4x.rb, line 250
  def []=( prop, v )
    @self.put( prop , v )
  end
_() click to toggle source

Shortcut for XPath ’@*’, meaning all attributes.

# File lib/r4x/e4x.rb, line 244
  def _ ; @self.get('@*') ; end
__class() click to toggle source

This is how the delegate accesses the node classification.

# File lib/r4x/e4x.rb, line 216
  def __class ; :xmllist ; end
__list() click to toggle source

This is how the delegate accesses the node.

# File lib/r4x/e4x.rb, line 213
  def __list  ; @list ; end
__target_object() click to toggle source

This is how the delegate accesses the node classification.

# File lib/r4x/e4x.rb, line 219
  def __target_object ; @target_object ; end
__target_object=(to) click to toggle source

(Not documented)

# File lib/r4x/e4x.rb, line 220
  def __target_object=(to) ; @target_object = to ; end
__target_property() click to toggle source

This is how the delegate accesses the node classification.

# File lib/r4x/e4x.rb, line 223
  def __target_property ; @target_property ; end
__target_property=(tp) click to toggle source

(Not documented)

# File lib/r4x/e4x.rb, line 224
  def __target_property=(tp) ; @target_property = tp ; end
each(&blk) click to toggle source

each

# File lib/r4x/e4x.rb, line 233
  def each(&blk) ; @list.each(&blk) ; end
method_missing( sym, *args ) click to toggle source
# File lib/r4x/e4x.rb, line 255
  def method_missing( sym, *args )
    sym = sym.to_s
p sym
    if (args.size > 0)
      self[0].send( sym, args )
    else
      self[0].send( sym )
    end
  end
self() click to toggle source

This is how to access the underlying Xml object, i.e. via the delegate.

# File lib/r4x/e4x.rb, line 210
  def self ; @self ; end
to_i() click to toggle source

?

# File lib/r4x/e4x.rb, line 230
  def to_i() @list.to_s.to_i; end
to_s() click to toggle source

Important for this to work in string interpolation.

# File lib/r4x/e4x.rb, line 227
  def to_s() @list.to_s ; end

Disabled; run with --debug to generate this.