echonest-ruby-api icon indicating copy to clipboard operation
echonest-ruby-api copied to clipboard

Add configurator

Open garethrees opened this issue 12 years ago • 1 comments

Came across rHAPI which has a lovely configuration block. Turn also does this.

Rather than

a = Echonest::Artist.new('Weezer', 'YOUR-API-KEY')

You could do

Echonest.config do |c|
  c.api_key = 'YOUR_API_KEY'
end

a = Echonest::Artist.new('Weezer')

Haven't looked in to this much but something I want to learn so happy to work on it together.

garethrees avatar Feb 13 '13 00:02 garethrees

Yeah that's a much tidier way of doing it. I'll look at refactoring it.

maxehmookau avatar Feb 13 '13 18:02 maxehmookau