Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/ektoplayer/compat.rb,
lib/ektoplayer/compat.rb

Instance Method Summary collapse

Instance Method Details

#clamp(min, max) ⇒ Object



11
12
13
14
15
# File 'lib/ektoplayer/compat.rb', line 11

def clamp(min, max)
   return min if self < min
   return max if self > max
   self
end

#negative?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/ektoplayer/compat.rb', line 21

def negative?
   return (self < 0)
end