> For the complete documentation index, see [llms.txt](https://ploegert.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ploegert.gitbook.io/til/programmy/ruby/evaluating-one-off-commands.md).

# Evaluating One-Off Commands

When I need to quickly test something out in Ruby, I will often reach for `irb`. However, there is an even quicker way to send a line of code to ruby for evaluation. Use the `ruby` binary with the `-e` flag followed by your line of ruby. For instance,

```
$ ruby -e 'puts Class.ancestors'
[Class, Module, Object, Kernel, BasicObject]
```
