Add a comma after <<-RUBY
:
Embed.toggler({
title: <<-RUBY,
RUBY
content: content
})
it generally works. I am not sure why it did not work in my code.
This did not work, because hashes require that the key / value pair be separated by a comma, for example {title: 'my title', content: 'my content' }
, and your code simply does not have a comma. It was hard to understand because of the cumbersome syntax of HEREDOC.
Do you know if there is a way to perform operations on a string?
. ( ) :
title = <<-RUBY
#{entry['time']}
#{entry['group']['who']
#{entry['name']}
RUBY
Embed.toggler(title: title.upcase, content: content)
, , HEREDOC-, , :
Embed.toggler({
title: <<-RUBY.upcase,
RUBY
content: content
})
, .