class Mail::Message

def decoded

def decoded
  case
  when self.text?
    decode_body_as_text
  when self.attachment?
    decode_body
  when !self.multipart?
    body.decoded
  else
    raise NoMethodError, 'Can not decode an entire message, try calling #decoded on the various fields and body or parts if it is a multipart message.'
  end
end