def line_items
      if line_items_downloaded?
        @line_items

      elsif bank_transaction_id =~ GUID_REGEX && @gateway
        # There is a bank_transaction_id so we can assume this record was loaded from Xero.
        # Let's attempt to download the line_item records (if there is a gateway)

        response = @gateway.get_bank_transaction(bank_transaction_id)
        raise BankTransactionNotFoundError, "Bank Transaction with ID #{bank_transaction_id} not found in Xero." unless response.success? && response.bank_transaction.is_a?(XeroGateway::BankTransaction)

        @line_items = response.bank_transaction.line_items
        @line_items_downloaded = true

        @line_items

      # Otherwise, this is a new bank transaction, so return the line_items reference.
      else
        @line_items
      end
    end
def line_items
      if line_items_downloaded?
        @line_items

      elsif bank_transaction_id =~ GUID_REGEX && @gateway
        # There is a bank_transaction_id so we can assume this record was loaded from Xero.
        # Let's attempt to download the line_item records (if there is a gateway)

        response = @gateway.get_bank_transaction(bank_transaction_id)
        raise BankTransactionNotFoundError, "Bank Transaction with ID #{bank_transaction_id} not found in Xero." unless response.success? && response.bank_transaction.is_a?(XeroGateway::BankTransaction)

        @line_items = response.bank_transaction.line_items
        @line_items_downloaded = true

        @line_items

      # Otherwise, this is a new bank transaction, so return the line_items reference.
      else
        @line_items
      end
    end
If line items are not downloaded, then attempt a download now (if this record was found to begin with).