Method: Rodbot::Config::Reader#eval_strings

Defined in:
lib/rodbot/config.rb

#eval_strings(*strings) ⇒ self

Eval configuration from strings

Parameters:

  • strings (String, nil)

    one or more strings to evaluate

Returns:

  • (self)


117
118
119
120
121
122
# File 'lib/rodbot/config.rb', line 117

def eval_strings(*strings)
  # TODO: filter magic comment until they are no longer requred to prevent warning
  strings = strings.map { _1&.sub(/# frozen_string_literal: true/, '') }
  instance_eval(strings.compact.join("\n"))
  self
end