Sha256: 9d6517679aec4f609d519fae7bfe03150a60a2da34dd5757e77d98f38f488449

Contents?: true

Size: 361 Bytes

Versions: 1

Compression:

Stored size: 361 Bytes

Contents

class Brut::FrontEnd::HttpStatus
  def initialize(number)
    number = number.to_i
    if ((number < 100) || (number > 599))
      raise ArgumentError,"'#{number}' is not a known HTTP status code"
    end
    @number = number
  end

  def to_i = @number
  def to_s = to_i.to_s

  def ==(other)
    self.class == other.class && self.to_i == other.to_i
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
brut-0.0.1 lib/brut/front_end/http_status.rb