Module: Cinnabar::StrToPath::Mixin

Defined in:
lib/cinnabar/path.rb

Overview

Note:

Side effect: this will affect all strings in the process, including third-party code. If you want scoped behavior, prefer Refin.

This is a "mixin switch": include Cinnabar::StrToPath::Mixin will modify String for the entire process (i.e., a monkey patch).

Examples:


include Cinnabar::StrToPath::Mixin

__dir__.to_path
# Same as `Pathname(__dir__)`

Class Method Summary collapse

Class Method Details

.included(_host) ⇒ void

This method returns an undefined value.

Hook invoked when this module is included.

Parameters:

  • _host (Module)

    the including host (unused)



74
# File 'lib/cinnabar/path.rb', line 74

def self.included(_host) = ::String.include Ext