Permalink
Browse files

Make .keys and .emails return Arrays.

The .keys and .emails methods were returning HTTParty responses which were
confusing to the caller, and contained an unnecessary level of depth. We now
index the response with the appropriate hash key, thus returning its Array
value.
  • Loading branch information...
1 parent 03da49d commit 3221a7f870af4126087451725f152411653f776e @runpaint committed Apr 23, 2009
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/octopi.rb
View
@@ -80,10 +80,11 @@ def initialize(login = nil, token = nil, format = "yaml")
self.class.default_params :login => login, :token => token
end
end
-
- %w[keys emails].each do |action|
+
+
+ {:keys => 'public_keys', :emails => 'emails'}.each_pair do |action, key|
define_method("#{action}") do
- get("/user/#{action}")
+ get("/user/#{action}")[key]
end
end

0 comments on commit 3221a7f

Please sign in to comment.