Permalink
Browse files

having the default params in a method didn't help anything, use the f…

…ormat defined for HTTParty
  • Loading branch information...
1 parent 0b0535d commit bfb1778adae53ad21966bfa3a5cddc6e6f640d9a @jduff committed Mar 13, 2011
Showing with 6 additions and 9 deletions.
  1. +6 −9 lib/tmdb_party.rb
View
@@ -84,14 +84,11 @@ def get_genres(lang = @default_lang)
end
private
- def default_path_items
- ['json', @api_key]
- end
-
- def method_url(method, lang, *args)
- url = [method, lang, default_path_items]
- url += args.collect{ |a| URI.escape(a.to_s) }
- '/' + url.join('/')
- end
+
+ def method_url(method, lang, *args)
+ url = [method, lang, self.class.format, @api_key]
+ url += args.collect{ |a| URI.escape(a.to_s) }
+ '/' + url.join('/')
+ end
end
end

1 comment on commit bfb1778

@Mange
Contributor
Mange commented on bfb1778 Mar 14, 2011

I suppose that url = [method, lang, *default_path_items] would work as well.
(Note the splat operator in there)

Please sign in to comment.