Skip to content

Instantly share code, notes, and snippets.

View tree.swift
protocol Node: Hashable {
var localizedName: String {get set}
}
class File: Node {
let fileID: Int
var localizedName: String
let hashValue : Int
View builds an element hash from a nokogiri xml doc with "-n" (n = counter) added to the name
# Converting Nokogiri parsed XML to_hash
# adds "-2", "-3", etc to the key in case of multiple items
# only elements
module Extensions
module Document
def to_hash
root.to_hash
end
end