| Class | WEBrick::HTTPVersion |
| In: |
webrick/httpversion.rb
|
| Parent: | Object |
| major | [RW] | |
| minor | [RW] |
# File webrick/httpversion.rb, line 16 def self.convert(version) version.is_a?(self) ? version : new(version) end
# File webrick/httpversion.rb, line 20 def initialize(version) case version when HTTPVersion @major, @minor = version.major, version.minor when String if /^(\d+)\.(\d+)$/ =~ version @major, @minor = $1.to_i, $2.to_i end end if @major.nil? || @minor.nil? raise ArgumentError, format("cannot convert %s into %s", version.class, self.class) end end
ruby-doc.org is a community service provided by James Britt and Happy Camper Studios, a Phoenix, Arizona, Ruby application development company.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.