Class: Patch::IO::Module

Inherits:
Object
  • Object
show all
Defined in:
lib/patch/io/module.rb

Overview

Manage node modules

Class Method Summary collapse

Class Method Details

.add(mod) ⇒ Array<Module>

Add an IO module to the list of modules available to Patch

Parameters:

Returns:



20
21
22
23
# File 'lib/patch/io/module.rb', line 20

def add(mod)
  @modules ||= []
  @modules << mod
end

.allArray<Module>

Mapping of node modules and names

Returns:



27
28
29
# File 'lib/patch/io/module.rb', line 27

def all
  @modules ||= []
end

.find_by_key(key) ⇒ Module

Find an IO module by its key

Parameters:

  • key (Symbol)

Returns:



13
14
15
# File 'lib/patch/io/module.rb', line 13

def find_by_key(key)
  all.find { |mod| mod::KEY === key }
end