0

I think I have seen a way to reduce this:

long_variable_name = long_variable_name.squeeze('i')

To something like this:

long_variable_name = &:squeeze('i')

But it doesn't work and I must be confusing. Just wondering if there is actually a way to do this ? Thanks

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
Aurelien
  • 339
  • 3
  • 12

1 Answers1

2

Do you mean this?

variable.squeeze!('i')

Note the bang (!).

spickermann
  • 100,941
  • 9
  • 101
  • 131