Method: Codebot::Sanitizers#valid_network

Defined in:
lib/codebot/sanitizers.rb

#valid_network(name, conf) ⇒ Network?

Sanitizes a network name.

Parameters:

  • name (String)

    the name of the network

  • conf (Hash)

    the configuration containing all networks

Returns:

  • (Network, nil)

    the corresponding network or nil on error



90
91
92
93
94
# File 'lib/codebot/sanitizers.rb', line 90

def valid_network(name, conf)
  return if name.nil?

  conf[:networks].find { |net| net.name_eql? name }
end