Class: RDF::RDFXML::Reader::Nokogiri::NodeSetProxy
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/rdf-rdfxml-6b89d4c13d63/lib/rdf/rdfxml/reader/nokogiri.rb
Overview
NodeSet proxy
Instance Attribute Summary collapse
-
#node_set ⇒ Object
readonly
Returns the value of attribute node_set.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#each {|| ... } ⇒ Object
Return a proxy for each child.
-
#initialize(node_set, parent) ⇒ NodeSetProxy
constructor
A new instance of NodeSetProxy.
-
#method_missing(method, *args) ⇒ Object
Proxy for everything else to @node_set.
-
#select {|| ... } ⇒ Array[NodeProxy]
Return selected NodeProxies based on selection.
Constructor Details
#initialize(node_set, parent) ⇒ NodeSetProxy
Returns a new instance of NodeSetProxy.
190 191 192 193 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-rdfxml-6b89d4c13d63/lib/rdf/rdfxml/reader/nokogiri.rb', line 190 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
#method_missing(method, *args) ⇒ Object
Proxy for everything else to @node_set
220 221 222 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-rdfxml-6b89d4c13d63/lib/rdf/rdfxml/reader/nokogiri.rb', line 220 def method_missing(method, *args) @node_set.send(method, *args) end |
Instance Attribute Details
#node_set ⇒ Object (readonly)
Returns the value of attribute node_set.
187 188 189 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-rdfxml-6b89d4c13d63/lib/rdf/rdfxml/reader/nokogiri.rb', line 187 def node_set @node_set end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
188 189 190 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-rdfxml-6b89d4c13d63/lib/rdf/rdfxml/reader/nokogiri.rb', line 188 def parent @parent end |
Instance Method Details
#each {|| ... } ⇒ Object
Return a proxy for each child
200 201 202 203 204 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-rdfxml-6b89d4c13d63/lib/rdf/rdfxml/reader/nokogiri.rb', line 200 def each @node_set.each do |c| yield NodeProxy.new(c, parent) end end |
#select {|| ... } ⇒ Array[NodeProxy]
Return selected NodeProxies based on selection
212 213 214 215 216 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-rdfxml-6b89d4c13d63/lib/rdf/rdfxml/reader/nokogiri.rb', line 212 def select @node_set.to_a.map {|n| NodeProxy.new(n, parent)}.select do |c| yield c end end |