ObjectiveFlickr 0.9.1 (Ruby)
This is a minor release. Three class methods are added to FlickrInvocation so that creating FlickrInvocation instances is now easier. Call FlickrInvocation’s class method default_api_key, default_shared_secret and default_options once, and you don’t have to repeat yourself again:
FlickrInvocation.default_api_key '(your_api_key_here)' FlickrInvocation.default_option :raise_exception_on_error => true # create an instance, you can use e.g. @@f in your Model class f = FlickrInvocation.new
Update 1: you can either put the above snippet (without the instance creation line) at the bottom of environment.rb of your Rails application, or just put the lines above in any of your model class.
Update 2: One of the perks of using the option :raise_exception_on_error is that if you have to check if the response block (instances of FlickrResponse) has any error. If you remember to supply with exception handlers (rescue blocks), you can always use what’s returned by the call. Plus if you make an mistake in retrieving what’s not in the returned hash, the exception handler can catch that for you too.
December 13th, 2006 at 08:26
Hi,
You have a slight typo in your example.
FlickrInvocation.defaultoption :raiseerroronexception => true
should be:
FlickrInvocation.defaultoptions :raiseerroronexception => true
Cheers,
Tim
December 13th, 2006 at 15:06
Thanks Tim, that has been corrected.
December 13th, 2006 at 22:33
[…] ObjectiveFlickr 0.9.1 is released. This is a minor update. For details, please refer to the ObjectiveFlickr blog article. […]