<commit_before>module Toggl
  class V8

    # name    : (string, required)
    # premium : If it's a pro workspace or not.
    #           Shows if someone is paying for the workspace or not (boolean, not required)
    # at      : timestamp that is sent in the response, indicates the time item was last updated

    def workspaces
      get "workspaces"
    end

    def clients(workspace=nil)
      if workspace.nil?
        get "clients"
      else
        get "workspaces/#{workspace}/clients"
      end
    end

    def projects(workspace, params={})
      active = params.has_key?(:active) ? "?active=#{params[:active]}" : ""
      get "workspaces/#{workspace}/projects#{active}"
    end

    def users(workspace)
      get "workspaces/#{workspace}/users"
    end

    def tasks(workspace, params={})
      active = params.has_key?(:active) ? "?active=#{params[:active]}" : ""
      get "workspaces/#{workspace}/tasks#{active}"
    end
  end
end
<commit_msg>Add dashboard() and leave_workspace(). Update params to workspace_id.<commit_after>module Toggl
  class V8

    # name    : (string, required)
    # premium : If it's a pro workspace or not.
    #           Shows if someone is paying for the workspace or not (boolean, not required)
    # at      : timestamp that is sent in the response, indicates the time item was last updated

    def workspaces
      get "workspaces"
    end

    def clients(workspace_id=nil)
      if workspace_id.nil?
        get "clients"
      else
        get "workspaces/#{workspace_id}/clients"
      end
    end

    def projects(workspace_id, params={})
      active = params.has_key?(:active) ? "?active=#{params[:active]}" : ""
      get "workspaces/#{workspace_id}/projects#{active}"
    end

    def users(workspace_id)
      get "workspaces/#{workspace_id}/users"
    end

    def tasks(workspace_id, params={})
      active = params.has_key?(:active) ? "?active=#{params[:active]}" : ""
      get "workspaces/#{workspace_id}/tasks#{active}"
    end

    def dashboard(workspace_id)
      get "dashboard/#{workspace_id}"
    end

    def leave_workspace(workspace_id)
      delete "workspaces/#{workspace_id}/leave"
    end
  end
end

{'fraction_non_alphanumeric': 0.11670480549199085, 'fraction_numerical': 0.0009153318077803204, 'mean_word_length': 2.7495711835334475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4006675', 'n_tokens_mistral': 692, 'n_tokens_neox': 665, 'n_words': 185}