module Rubillow::Models::Linkable
Common data for responses containing links
Attributes
links[RW]
@return [Hash] Links (format: :name => ‘url’)
@example
links.each do |name, url end
Protected Instance Methods
extract_links(xml)
click to toggle source
@private
# File lib/rubillow/models/linkable.rb, line 16 def extract_links(xml) @links = {} # TODO: clean up this logic if !xml.xpath('//result/links').empty? selector = '//result/links' elsif !xml.xpath('//response/links').empty? selector = '//response/links' elsif !xml.xpath('//principal/links').empty? selector = '//principal/links' elsif !xml.xpath('//comp/links').empty? selector = '//comp/links' else selector = '//links' end xml.xpath(selector).children.each do |link| next if link.name == "myzestimator" # deprecated @links[link.name.to_sym] = link.text end end