saasbook

movie.3.rb

May 1st, 2012
697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.32 KB | None | 0 0
  1. class Movie < ActiveRecord::Base
  2.  
  3.   class Movie::InvalidKeyError < StandardError ; end
  4.  
  5.   def self.find_in_tmdb(string)
  6.     begin
  7.       TmdbMovie.find(:title => string)
  8.     rescue ArgumentError => tmdb_error
  9.       raise Movie::InvalidKeyError, tmdb_error.message
  10.     end      
  11.   end
  12.  
  13.   # rest of file elided for brevity
  14. end
Advertisement
Add Comment
Please, Sign In to add comment