to_isbn_string end def etc end end We can scatter ISBN.new(obj) around the system and the ISBN class doesn't need insights into the cleansing for a string or a number.
new ( gsub ( /[^[:digit:]]/, "" )) end end refine Integer do def to_isbn ISBN.