Please read and bookmark this …
Tim your example violates Ruby language conventions and good practices.
def ReinitiateComponent (originaldefn, entityliststr)
a. Do not put a space between the method name and it’s argument list.
This causes warnings to be spit out to STDOUT.
b. Ruby uses CamelCase
(aka SnakeCase
) constant identifiers for class and module idnetifiers.
Method names and variables (note that parameter names are actually local variables to the method) should be all lower case with words separated using underscore characters.
SHOUTED_NAMES are used for constants.
c. all operators should have space before and after.
(Note if you wish to break Ruby convention in your own code that only you need to read, then this is fine but you should not post such code for others … especially new coders.)
Find (or build) a concise (and workable) coding style guide. See: https://ruby.style/
(Some of these guides are way too subjective and have too many rules that do not explain reasonings.)
There are numerous good free books available for Ruby. See the lists I created: