12 lines
307 B
Ruby
Raw Normal View History

2011-10-06 15:31:17 +04:00
module MusicBrainz
class Base
def self.safe_get_attr xml, path, name
xml.css(path).first.attr(name) unless xml.css(path).empty? or xml.css(path).first.attr(name).nil?
end
def self.safe_get_value xml, path
xml.css(path).first.text unless xml.css(path).empty?
end
end
end