lib/wagon/ward.rb in wagon-1.1.1 vs lib/wagon/ward.rb in wagon-2.0.0

- old
+ new

@@ -4,12 +4,16 @@ class Ward < Page def name @name ||= self.at('a.channeltitle[href^="/units/home"]').inner_text.strip end + def ward_id + @ward_id ||= @url.sub(%r{^.+\-(\d+),\d+\.html$}, '\1') + end + def directory_path - @directory_path ||= '/units/a/directory/photoprint/1,10357,605-1-7-197742,00.html' + @directory_path ||= "/units/a/directory/photoprint/1,10357,605-1-7-#{ward_id},00.html" end def directory @directory ||= Directory.new(connection, directory_path, self) end @@ -24,6 +28,6 @@ def to_pdf(options) directory.to_pdf(options) end end -end \ No newline at end of file +end