Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the inline string block in Ruby named "eos"? [closed]

Tags:

syntax

ruby

Why is the inline string block in Ruby named "eos"?

Update

Thank you for denoting the right way. I always thought that "eos" was a reserved word, but it seems that any word may be used:

a = <<MYSTRING
line 1
line 2
mystring #the thing is case sensitive
line3
MYSTRING
#The actual end of the string

I also discovered that this construction is named Heredoc

This showed me that even the silliest questions can be a learning opportunity.

like image 681
Paul Avatar asked Feb 15 '13 11:02

Paul


1 Answers

EOS means end of string. it is displayed at the end of the string.

EOS means more than GFJKDHAGJHFGDJ for example.

But you can use other names, too.

like image 103
User Avatar answered Sep 26 '22 17:09

User