Closed mudge closed 9 years ago
Some questions for reviewers:
EmbiggenedURI
is a bit of an unwieldy name: perhaps we should go for something simpler like Embiggen::Result
?expand!
led me to extract an EmptyLocation
Null Object but it currently just sits in lib/embiggen/uri.rb
; is it worth extracting into its own file?Discussed in a group:
URI
instead of an Addressable::URI
if possible;trace
(then expand
could be implemented in terms of trace.last
).
GitHub: https://github.com/altmetric/embiggen/issues/1
As discussed in #1, rather than having two expansion methods (one gracefully handling errors but not communicating any information about them and one eagerly raising exceptions), consistently return a sum type from
expand
that both encapsulates exceptions and communicates success:Embiggen::EmbiggenedURI
delegates to an internalAddresssable::URI
but does so explicitly throughForwardable
rather thanSimpleDelegator
: some methods are delegated (e.g.host
,inferred_port
,request_uri
) but only for convenience and the true way to get aURI
instance is to useEmbiggen::EmbiggenedURI#uri
.