Module: Polyfill::V2_5::Integer

Defined in:
lib/polyfill/v2_5/integer.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#allbits?(mask) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
55
# File 'lib/polyfill/v2_5/integer.rb', line 52

def allbits?(mask)
  imask = InternalUtils.to_int(mask)
  self & imask == imask
end

#anybits?(mask) ⇒ Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/polyfill/v2_5/integer.rb', line 57

def anybits?(mask)
  self & InternalUtils.to_int(mask) != 0
end

#ceilObject



36
37
38
# File 'lib/polyfill/v2_5/integer.rb', line 36

def ceil(*)
  super.to_i
end

#floorObject



40
41
42
# File 'lib/polyfill/v2_5/integer.rb', line 40

def floor(*)
  super.to_i
end

#nobits?(mask) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/polyfill/v2_5/integer.rb', line 61

def nobits?(mask)
  self & InternalUtils.to_int(mask) == 0
end

#roundObject



44
45
46
# File 'lib/polyfill/v2_5/integer.rb', line 44

def round(*)
  super.to_i
end

#truncateObject



48
49
50
# File 'lib/polyfill/v2_5/integer.rb', line 48

def truncate(*)
  super.to_i
end