Class: Kettle::Wash::Change

Inherits:
Module
  • Object
show all
Defined in:
lib/kettle/wash.rb,
sig/kettle/wash.rbs

Defined Under Namespace

Modules: ConstantChange

Instance Method Summary collapse

Constructor Details

#initialize(constants: nil, path: nil) ⇒ Change

Returns a new instance of Change.

Parameters:

  • constants: (nil, String, Symbol, Array[String | Symbol]) (defaults to: nil)
  • path: (nil, String) (defaults to: nil)


61
62
63
64
65
# File 'lib/kettle/wash.rb', line 61

def initialize(constants: nil, path: nil)
  super()
  @constants = Array(constants) if constants
  @path = path if path
end

Instance Method Details

#included(base) ⇒ nil

Parameters:

  • base (Module)

Returns:

  • (nil)


67
68
69
70
71
72
73
# File 'lib/kettle/wash.rb', line 67

def included(base)
  constants = @constants
  path = @path
  return unless constants && path

  base.extend(ConstantChange.to_mod(constants: constants, path: path))
end