Object
The root parser object. Every parser must extend this object.
Parses the given feed, and returns a normalized representation. Returns nil if the feed could not be parsed.
# File lib/feed-normalizer.rb, line 16 16: def self.parse(feed, loose) 17: nil 18: end
Parser being used.
# File lib/feed-normalizer.rb, line 10 10: def self.parser 11: nil 12: end
# File lib/feed-normalizer.rb, line 53 53: def self.append_or_set!(value, object, object_function) 54: if object.send(object_function).respond_to? :push 55: object.send(object_function).push(value) 56: else 57: object.send(:"#{object_function}=", value) 58: end 59: end
sets value, or appends to an existing value
# File lib/feed-normalizer.rb, line 32 32: def self.map_functions!(mapping, src, dest) 33: 34: mapping.each do |dest_function, src_functions| 35: src_functions = [src_functions].flatten # pack into array 36: 37: src_functions.each do |src_function| 38: value = if src.respond_to?(src_function) 39: src.send(src_function) 40: elsif src.respond_to?(:has_key?) 41: src[src_function] 42: end 43: 44: unless value.to_s.empty? 45: append_or_set!(value, dest, dest_function) 46: break 47: end 48: end 49: 50: end 51: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.