Sha256: 32cb507597d331515e4a9bce0a7d5a7b01437c33a9ee5911b9241d85b5a38b20
Contents?: true
Size: 503 Bytes
Versions: 12
Compression:
Stored size: 503 Bytes
Contents
module Ddr::Models class FindingAid attr_reader :ead_id def initialize(ead_id) @ead_id = ead_id end def url @url ||= doc.css("eadid").attr("url").text end def title @title ||= doc.css("titleproper").children.first.text.strip end private # @raise [OpenURI::HTTPError] if 404, etc. def doc @doc ||= Nokogiri::XML(open(ead_xml_url)) end def ead_xml_url Ddr::Models.ead_xml_base_url + ead_id + ".xml" end end end
Version data entries
12 entries across 12 versions & 1 rubygems