title: Ruby replace if block with guard
body: <p>I've got a service object which creates the CSV file from assigned data. The call method is pretty simple:</p>
  <pre><code>  def initialize(data)
      @data = data
    end
  
    def call
      CSV.generate(headers: true, col_sep: ';') do |csv|
        csv &lt;&lt; csv_headers
  
        data.uniq.each do |contract|
          next if contract.transient
  
          payment_details = [
            next_payment_date(contract),
            I18n.t(&quot;contracts.interval_options.#{contract.recurring_transaction_interval&amp;.name}&quot;),
          ]
          csv &lt;&lt; payment_details
        end
      end
    end
  
    private
  
    def next_payment_date(contract)
      if contract.upcoming_installment.nil?
        I18n.t('tables.headers.no_next_payment_date')
      else
        contract.upcoming_installment.transaction_date.to_s
      end
    end
  </code></pre>
  <p>It works well but I don't think <code>next_payment_date</code> is really fancy if block, I'm wondering is it possible to replace it with some guard instead?</p>
  <p>Because of rubocop I cannot use:</p>
  <pre><code>contract.upcoming_installment.nil? ? I18n.t('tables.headers.no_next_payment_date') : contract.upcoming_installment.transaction_date.to_s
  </code></pre>