---
title: "Heredoc แบบไม่มี interpolation"
description: "บางครั้งคุณอาจอยากใช้ Heredoc ของ Ruby แบบไม่มี interpolation ('#{....}') ซึ่งทำได้โดยใส่ dash เดี่ยวรอบ keyword:"
canonical: https://oozou.com/til/heredoc-without-interpolation-74
locale: th
date: 2020-10-14
topic: ruby
---

# Heredoc แบบไม่มี interpolation

> บางครั้งคุณอาจอยากใช้ Heredoc ของ Ruby แบบไม่มี interpolation ('#{....}') ซึ่งทำได้โดยใส่ dash เดี่ยวรอบ keyword:

Published: 2020-10-14 · Topic: [ruby](https://oozou.com/th/til-topics/ruby) ([markdown](https://oozou.com/th/til-topics/ruby.md))

บางครั้งคุณอาจอยากใช้ Heredoc ของ Ruby แบบไม่มี interpolation ('#\{....}') ซึ่งทำได้โดยใส่ dash เดี่ยวรอบ keyword:

```ruby
doc = <<-'SONG'
Business men, they drink my wine
#{person} dig my earth
None will level on the line
Nobody offered his word
Hey, hey
SONG
```

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/th/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
