class Superfeedr::Node
Public Class Methods
new(node)
click to toggle source
# File lib/superfeedr/superfeedr.rb, line 6 def initialize(node) @node = node end
Private Instance Methods
content_from(name, ns = nil)
click to toggle source
# File lib/superfeedr/superfeedr.rb, line 12 def content_from(name, ns = nil) child = xpath(name, ns).first child.content if child end
datetime_from(name, ns = nil)
click to toggle source
# File lib/superfeedr/superfeedr.rb, line 17 def datetime_from(name, ns = nil) datetime = content_from(name, ns) DateTime.parse(datetime) if datetime end
integer_from(name, ns = nil)
click to toggle source
# File lib/superfeedr/superfeedr.rb, line 22 def integer_from(name, ns = nil) int = content_from(name, ns) int.to_i if int end
xpath(name, ns = nil)
click to toggle source
# File lib/superfeedr/superfeedr.rb, line 27 def xpath(name, ns = nil) ns ||= {:atom => ATOM, :geo => GEO, :sf => SF} @node.xpath(name, ns) end