This is a topic in Basecamp API
Weird code in the ruby wrapper
|
|
I was looking at the ruby wrapper for the api, and I came across this line of code: if response.code.to_i / 100 2 Why would you do this? Is there an advantage to comparing response.code ‘200’ (which they do a few lines down for 302s)? |
|
|
Over 700 readers and no reply? So I guess there’s no good explaination for this? |
|
|
Hi Matt— It’s so response codes anywhere within the 200-299 range will be interpreted as success: $ irb >> 201 / 100 == 2 => true |
|
|
Ahh, I see! Thanks Jeff! |
