lib/ruby-tmdb/tmdb_cast.rb in ruby-tmdb-0.1.2 vs lib/ruby-tmdb/tmdb_cast.rb in ruby-tmdb-0.1.3
- old
+ new
@@ -14,9 +14,10 @@
unless(options[:name].nil? || options[:name].to_s.empty?)
results << Tmdb.api_call('Person.search', options[:name])
end
results.flatten!
+ results.compact!
unless(options[:limit].nil?)
raise ArgumentError, ":limit must be an integer greater than 0" unless(options[:limit].is_a?(Fixnum) && options[:limit] > 0)
results = results.slice(0, options[:limit])
end
\ No newline at end of file