Rubyists life made easier with composition operators.

If you write Ruby code and wandered into FP world you might just started writing those little tiny methods inside your classes/modules. And that was awesome to write code like this:

classImport# Some code goes here...deffind_record(row)[Msa.find_or_initialize_by(region_name: row[:region_name],city: row[:city],state: row[:state],metro: row[:metro]),row]end# record is one of:# Object - when record was found# false - when record was not founddefupdate_record(record,attributes)record.attributes=attributesrecordend# record is one of:# false# ZipRegiondefvalidate_record(record)caserecordwhenfalse[:error,nil]elsevalidate_record!(record)endend# record is ZipRegion objectdefvalidate_record!(record)ifrecord.valid?[:ok,record]elseerror(record.id,record.errors.messages)[:error,record]endenddefpersist_record!(validation,record)casevalidationwhen:okrecord.savewhen:errorfalseendendend

Yeah, I know there is YARD, and argument types are somewhat weird but at the time of coding, I was fascinated with Gregor Kiczales's HTDP courses (that was a ton of fun, sincerely recommend for every adventurous soul).