Class: Nokogiri::XML::Node
- Inherits:
-
Object
- Object
- Nokogiri::XML::Node
- Defined in:
- lib/rdf/rdfxml/patches/nokogiri_hacks.rb
Instance Method Summary collapse
-
#attribute_with_ns(name, namespace) ⇒ Nokogiri::XML::Attr
Monkey patch attribute_with_ns, to insure nil is returned for #null?.
- #attribute_with_ns_without_ffi_null ⇒ Object
- #display_path ⇒ Object
-
#uri ⇒ Object
URI of namespace + node_name.
Instance Method Details
#attribute_with_ns(name, namespace) ⇒ Nokogiri::XML::Attr
Monkey patch attribute_with_ns, to insure nil is returned for #null?
Get the attribute node with name and namespace
26 27 28 29 30 |
# File 'lib/rdf/rdfxml/patches/nokogiri_hacks.rb', line 26 def attribute_with_ns(name, namespace) a = attribute_with_ns_without_ffi_null(name, namespace) (a.respond_to?(:null?) && a.null?) ? nil : a # to ensure FFI Pointer compatibility end |
#attribute_with_ns_without_ffi_null ⇒ Object
17 |
# File 'lib/rdf/rdfxml/patches/nokogiri_hacks.rb', line 17 alias_method :attribute_with_ns_without_ffi_null, :attribute_with_ns |
#display_path ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/rdf/rdfxml/patches/nokogiri_hacks.rb', line 9 def display_path @display_path ||= case self when Nokogiri::XML::Document then "" when Nokogiri::XML::Element then parent ? "#{parent.display_path}/#{name}" : name when Nokogiri::XML::Attr then "#{parent.display_path}@#{name}" end end |