Class: RDF::RDFa::Reader::REXML::NodeSetProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/rdf/rdfa/reader/rexml.rb

Overview

NodeSet proxy

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (NodeSetProxy) initialize(node_set, parent)

A new instance of NodeSetProxy



139
140
141
142
# File 'lib/rdf/rdfa/reader/rexml.rb', line 139

def initialize(node_set, parent)
  @node_set = node_set
  @parent = parent
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(method, *args)

Proxy for everything else to @node_set



157
158
159
# File 'lib/rdf/rdfa/reader/rexml.rb', line 157

def method_missing(method, *args)
  @node_set.send(method, *args)
end

Instance Attribute Details

- (Object) node_set (readonly)

Returns the value of attribute node_set



136
137
138
# File 'lib/rdf/rdfa/reader/rexml.rb', line 136

def node_set
  @node_set
end

- (Object) parent (readonly)

Returns the value of attribute parent



137
138
139
# File 'lib/rdf/rdfa/reader/rexml.rb', line 137

def parent
  @parent
end

Instance Method Details

- (Object) each

Return a proxy for each child

@yield(child) @yieldparam(NodeProxy)



149
150
151
152
153
# File 'lib/rdf/rdfa/reader/rexml.rb', line 149

def each
  @node_set.each do |c|
    yield NodeProxy.new(c, parent)
  end
end