lib/pmp/parser.rb in pmp-0.1.3 vs lib/pmp/parser.rb in pmp-0.2.0
- old
+ new
@@ -61,32 +61,32 @@
end
end
def parse_links(document)
Array(document).each do |k,v|
- link = parse_link(k,v)
+ link = parse_link(k,v)
if link
self.links[k] = link
end
end
end
def parse_link(name, info)
if ['query', 'edit', 'navigation'].include?(name.to_s)
parse_links_list(info)
elsif !info.is_a?(Array)
- Link.new(self, info)
+ Link.new(info)
elsif info.size == 1
- Link.new(self, info.first)
+ Link.new(info.first)
elsif info.size > 0
- info.map{|l| Link.new(self, l)}
+ info.map{|l| Link.new(l)}
end
end
def parse_links_list(links)
links.inject({}) do |results, query|
rel = query['rels'].first
- results[rel] = Link.new(self, query)
+ results[rel] = Link.new(query)
results
end
end
def parse_items(document)