def line_items
      if line_items_downloaded?
        @line_items

      # There is an credit_note_is so we can assume this record was loaded from Xero.
      # attempt to download the line_item records.
      elsif credit_note_id =~ GUID_REGEX
        raise NoGatewayError unless @gateway

        response = @gateway.get_credit_note(credit_note_id)
        raise CreditNoteNotFoundError, "CreditNote with ID #{credit_note_id} not found in Xero." unless response.success? && response.credit_note.is_a?(XeroGateway::CreditNote)

        @line_items = response.credit_note.line_items
        @line_items_downloaded = true

        @line_items

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

      # There is an credit_note_is so we can assume this record was loaded from Xero.
      # attempt to download the line_item records.
      elsif credit_note_id =~ GUID_REGEX
        raise NoGatewayError unless @gateway

        response = @gateway.get_credit_note(credit_note_id)
        raise CreditNoteNotFoundError, "CreditNote with ID #{credit_note_id} not found in Xero." unless response.success? && response.credit_note.is_a?(XeroGateway::CreditNote)

        @line_items = response.credit_note.line_items
        @line_items_downloaded = true

        @line_items

      # Otherwise, this is a new credit_note, 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).