The repeated `elsif input == ...` here could be replaced with a `case`/`when` block:

```
case input
  when 1
    # use operator 1
  when 2
    # use operator 2
end
```

And etc.