Class: Numeric

Inherits:
Object
  • Object
show all
Includes:
Rupture::Lookup
Defined in:
lib/rupture/lookup.rb,
lib/rupture/core_ext.rb

Instance Method Summary collapse

Methods included from Rupture::Lookup

#lookup

Instance Method Details

#decObject



6
7
8
# File 'lib/rupture/core_ext.rb', line 6

def dec
  self - 1
end

#incObject



2
3
4
# File 'lib/rupture/core_ext.rb', line 2

def inc
  self + 1
end

#neg?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rupture/core_ext.rb', line 14

def neg?
  self < 0
end

#pos?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/rupture/core_ext.rb', line 10

def pos?
  self > 0
end

#zero?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/rupture/core_ext.rb', line 18

def zero?
  self == 0
end