I would like to chain my own methods in Ruby. Instead of writing ruby methods and using them like this:
def percentage_to_i(percentage)
percentage.chomp('%')
percentage.to_i
end
percentage = "75%"
percentage_to_i(percentage)
=> 75
I would like to use it like this:
percentage = "75%"
percentage.percentage_to_i
=> 75
How can I achieve this?
Percentclass?