Add a new method with eval
class String eval %{def last(n) self[-n, n] end} end "Here's a string.".last(7) # => "string."