[Sass] Make Number#{gte,lt,lte} raise proper errors when used with non-Numbers.

This commit is contained in:
Nathan Weizenbaum 2009-04-24 01:13:10 -07:00
parent ad36db1346
commit 05bf43915c
1 changed files with 3 additions and 3 deletions

View File

@ -77,17 +77,17 @@ module Sass::Script
end
def gte(other)
raise NoMethodError.new(nil, :gt) unless other.is_a?(Number)
raise NoMethodError.new(nil, :gte) unless other.is_a?(Number)
operate(other, :>=)
end
def lt(other)
raise NoMethodError.new(nil, :gt) unless other.is_a?(Number)
raise NoMethodError.new(nil, :lt) unless other.is_a?(Number)
operate(other, :<)
end
def lte(other)
raise NoMethodError.new(nil, :gt) unless other.is_a?(Number)
raise NoMethodError.new(nil, :lte) unless other.is_a?(Number)
operate(other, :<=)
end