mirror of
https://github.com/neocities/neocities.git
synced 2025-07-25 20:08:27 +02:00
more strict integer checks
This commit is contained in:
parent
1d87b87e62
commit
f7e65ec61b
10 changed files with 30 additions and 21 deletions
|
@ -6,4 +6,8 @@ class NilClass
|
|||
def blank?
|
||||
true
|
||||
end
|
||||
|
||||
def not_an_integer?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -76,4 +76,8 @@ class Numeric
|
|||
def to_space_pretty
|
||||
to_bytes_pretty
|
||||
end
|
||||
|
||||
def not_an_integer?
|
||||
!self.integer?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,4 +16,11 @@ class String
|
|||
return true if self == ''
|
||||
false
|
||||
end
|
||||
|
||||
def not_an_integer?
|
||||
Integer(self)
|
||||
false
|
||||
rescue ArgumentError
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue