discogs icon indicating copy to clipboard operation
discogs copied to clipboard

Extension points

Open eiked opened this issue 10 years ago • 1 comments

In my client code I need to obtain the barcode of a release.

I currently do (as of Discogs::Wrapper,v2) barcode = release.identifiers && release.identifiers.find{|i|i.type=='Barcode'} self.ean = barcode && barcode.value.strip

Back in Discogs::Wrapper,v1 I monkey patched Discogs::Release so that release.barcode was available everywhere

First of all: the change to Hashie::Mash is very good!

But let's have the responses typed again, to enable extending again: like class Discogs::Release < Hashie::Mash

or maybe even introducing an extension point for all discogs responses like Discogs::Release < Discogs::Response < Hashie::Mash

eiked avatar Jun 19 '14 20:06 eiked

Ok, it's taken three years. But I've finally decided to come back and bring the typed responses back.

I'm going to merge my old, typed version of the wrapper into the current version which is using Hashie. Hopefully with that we will have the best of both worlds.

This will be a breaking change and thus I'll need to be a little bit careful about the rollout. I guess we'll bump it to v3.0.0 when complete.

buntine avatar May 06 '17 12:05 buntine