123456789_123456789_123456789_123456789_123456789_

Module: Net::IMAP::Utils

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Extended In:
Included In:
Defined in: lib/net/imap/utils.rb

Overview

INTERNAL utility methods. API is unstable and subject to change.

Class Method Summary

Class Method Details

.implicit_int(input) (mod_func)

This method is for internal use only.

Something like this exists in ruby's C API. Why not in ruby's ruby?

[ GitHub ]

  
# File 'lib/net/imap/utils.rb', line 14

def implicit_int(input)
  Integer.try_convert(input) or
    raise TypeError, case input
      when nil
        "no implicit conversion from %p to Integer" % [input]
      when true, false
        "no implicit conversion of %p into Integer" % [input]
      else
        "no implicit conversion of %s into Integer" % [input.class.name]
      end
end

.shareable(&b) (mod_func)

This method is for internal use only.

simplecov:disable

See additional method definition at line 38.

[ GitHub ]

  
# File 'lib/net/imap/utils.rb', line 43

def shareable
  case obj = yield
  when Proc
    Ractor.shareable_proc(&obj)
  else
    Ractor.make_shareable obj
  end
end