here doc

기본

string = <<END_OF_STRING
You can enter as many
lines as you like here
but will end this string
with...
END_OF_STRING


Dynamic String

planet = 'Earth'
string = <<END_OF_STRING
Hello, #{planet}
END_OF_STRING

puts string # Hello, Earth


Indenting
: Tag가 Indent를 가진 경우 루비는 기본적으로 인식하지 못하고 에러난다.
  Tag에 '-'를 붙여주면 된다.
  Indent 깊이에 관계없이 '-' 는 하나만 붙인다.

string = <<-END_OF_STRING
    Notice the hyphen after the
    << characters above
    END_OF_STRING

by Augie | 2008/01/23 11:37 | 트랙백

트랙백 주소 : http://ironcpa.egloos.com/tb/3588832
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
※ 로그인 사용자만 덧글을 남길 수 있습니다.

◀ 이전 페이지          다음 페이지 ▶