require 'csv' module ErrandBoy class CSV class SlackInvite < Base def headers result = %w(sender_name sender_email register_name register_email team) result.to_csv end def values result = [@request.sender['name'].to_s, @request.sender['email'].to_s, @request.register['name'].to_s, @request.register['email'].to_s, @request.destination['team'].to_s] result.to_csv end def duplicated? include?(:register_email, @request.register['email'].to_s) end end end end