Skip to content

Commit

Permalink
Fix intentional nil code
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Mar 13, 2011
1 parent 059e01f commit fdfdcc7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/net2/http/statuses.rb
Expand Up @@ -37,14 +37,17 @@ def self.subclass(name, code, options = {})
klass.const_set :HAS_BODY, options.key?(:body) ? options[:body] : self::HAS_BODY
klass.const_set :EXCEPTION_TYPE, options[:error] || self::EXCEPTION_TYPE

# for backwards compatibility with Net::HTTP
Net2.const_set "HTTP#{name}", klass

return unless code

if code < 100
CODE_CLASS_TO_OBJ[code.to_s] = klass
else
CODE_TO_OBJ[code.to_s] = klass
end

# for backwards compatibility with Net::HTTP
Net2.const_set "HTTP#{name}", klass
end
end

Expand Down

0 comments on commit fdfdcc7

Please sign in to comment.