Class: Kubrick::Movie
- Inherits:
-
Object
- Object
- Kubrick::Movie
- Defined in:
- lib/kubrick.rb
Class Method Summary collapse
Class Method Details
.find_by_director(name) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/kubrick.rb', line 21 def self.find_by_director(name) if name.nil? raise Errors::KubrickError "Movie.find_by_director: name cannot be nil" end @svc.People.filter("Name eq '#{name}'").('TitlesDirected') person = @svc.execute parsed = JSON.parse(person.to_json) parsed[0]['TitlesDirected'] end |
.find_by_title(title) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/kubrick.rb', line 11 def self.find_by_title(title) if title.nil? raise Errors::KubrickError "Movie.find_by_title: title cannot be nil." else @svc.Titles.filter("Name eq '#{title}'") movie = @svc.execute JSON.parse(movie.to_json) # I know, this is horrible, but I couldn't get it to work any other way. end end |