Module: Polyfill::V2_5::Integer
- Defined in:
- lib/polyfill/v2_5/integer.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #allbits?(mask) ⇒ Boolean
- #anybits?(mask) ⇒ Boolean
- #ceil ⇒ Object
- #floor ⇒ Object
- #nobits?(mask) ⇒ Boolean
- #round ⇒ Object
- #truncate ⇒ Object
Instance Method Details
#allbits?(mask) ⇒ 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
57 58 59 |
# File 'lib/polyfill/v2_5/integer.rb', line 57 def anybits?(mask) self & InternalUtils.to_int(mask) != 0 end |
#ceil ⇒ Object
36 37 38 |
# File 'lib/polyfill/v2_5/integer.rb', line 36 def ceil(*) super.to_i end |
#floor ⇒ Object
40 41 42 |
# File 'lib/polyfill/v2_5/integer.rb', line 40 def floor(*) super.to_i end |
#nobits?(mask) ⇒ Boolean
61 62 63 |
# File 'lib/polyfill/v2_5/integer.rb', line 61 def nobits?(mask) self & InternalUtils.to_int(mask) == 0 end |
#round ⇒ Object
44 45 46 |
# File 'lib/polyfill/v2_5/integer.rb', line 44 def round(*) super.to_i end |
#truncate ⇒ Object
48 49 50 |
# File 'lib/polyfill/v2_5/integer.rb', line 48 def truncate(*) super.to_i end |