Mostly robocop and hound give "line is too long" for such code statements. I just wanted to know which one is better and preferable way.
This one is a way to avoid making the message long so just do multiple string interpolation:
timeGet = "<span class='message'>after #{getTime2(online, offline)}</span>"
logs[index].extra = {message: "Camera came online #{timeGet}"}
This next one is to not do multiple string interpolation but just expand the JSON object to the new line to avoid "line is too long". What do you think is a good and preferable way of coding?
logs[index].extra = {
message: "Camera came online <span class='message'>after #{getTime2(online, offline)}</span>"
}