Skip to content

Commit

Permalink
make it work if there is only one email
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Jan 29, 2012
1 parent 8739f09 commit 31287ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/google.rb
Expand Up @@ -51,7 +51,9 @@ def email
headers: {"Authorization" => "OAuth #{token}"}
)
result = Hash.from_xml(result)
Array((result["feed"]["entry"] || [])).map {|e| Email.new(e) }
result = result["feed"]["entry"] || []
result = [result] unless result.is_a?(Array)
result.map {|e| Email.new(e) }
end

def calendar
Expand Down

0 comments on commit 31287ce

Please sign in to comment.