prismicio/ruby-kit — pull request #26 by rudyrigot (2014-01-30 00:50:57+00:00)
Title: A unified way to call the Link#url

One of the features in 1.0.0.rc1 turns out to be incomplete:
* the purpose was to give each class implementing `Prismic::Fragments::Link` an `url` method, so we could call `url` on a link object without needing to know its type (`WebLink`, or `DocumentLink`, or `FileLink`, or `ImageLink`).
* the issue is that actually, they don't always have the same signature in 1.0.0.rc1. Sometimes it's `url(link_resolver)`, sometimes it's `url(link_resolver=nil)`, and sometimes just `url`. So in reality, you can't call it regardless of the kind of link, because depending on the link, it sometimes raises an `ArgumentError`, despite all methods working well independently (it didn't occur to me check that, and since all was working well...)
* the solution: now they're all `url(link_resolver=nil)`, including the one in `Prismic::Fragments::Link`, which now raises a NotImplementedError.

I wrote tests on what I could, but `Link.image` and `Link.file` links have issues in the API these days.

I monkey-patched my example website to make sure this solves the problem, and it does.