lib/pmp/parser.rb in pmp-0.1.2 vs lib/pmp/parser.rb in pmp-0.1.3
- old
+ new
@@ -69,15 +69,17 @@
end
end
end
def parse_link(name, info)
- if !info.is_a?(Array)
+ if ['query', 'edit', 'navigation'].include?(name.to_s)
+ parse_links_list(info)
+ elsif !info.is_a?(Array)
Link.new(self, info)
elsif info.size == 1
Link.new(self, info.first)
- elsif info.size > 0
- parse_links_list(info)
+ elsif info.size > 0
+ info.map{|l| Link.new(self, l)}
end
end
def parse_links_list(links)
links.inject({}) do |results, query|