---
title: "Ruby 3 adds endless method definition"
description: "Ruby 3 adds endless method definition"
canonical_url: "https://www.bigbinary.com/blog/ruby-3-adds-endless-method-definition"
markdown_url: "https://www.bigbinary.com/blog/ruby-3-adds-endless-method-definition.md"
---

# Ruby 3 adds endless method definition

Ruby 3 adds endless method definition

- Author: Akhil Gautam
- Published: September 15, 2020
- Categories: Ruby, Ruby 3

Ruby 3.0 adds endless method definition. It enables us to create method
definitions without the need of `end` keyword. It is marked as an experimental
feature.

```ruby
# endless method definition
>> def raise_to_power(number, power) = number ** power

>> raise_to_power(2, 5)

=> 32

```

The discussion around it can be found
[here](https://bugs.ruby-lang.org/issues/16746). Check out the
[pull request](https://github.com/ruby/ruby/pull/2996/files) for more details on
this.

## Links

- [Human page](https://www.bigbinary.com/blog/ruby-3-adds-endless-method-definition)
