Permalink
Browse files

Break test into if/else block for readability

  • Loading branch information...
1 parent 7bb62d1 commit f95b8eda340349acd8ae918bd1367bb2e5198d12 @gravis gravis committed Jun 10, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/typhoeus/easy.rb
View
@@ -242,8 +242,11 @@ def set_option(option, value)
def perform
set_headers()
easy_perform()
- resp_code = response_code()
- (resp_code >= 200 and resp_code <= 299) ? success : failure
+ if resp_code = response_code() && resp_code >= 200 && resp_code <= 299
+ success
+ else
+ failure
+ end
resp_code
end

0 comments on commit f95b8ed

Please sign in to comment.