Class: Fathom::TeamMember

Inherits:
Resource show all
Defined in:
lib/fathom/resources/team_member.rb

Instance Attribute Summary

Attributes inherited from Resource

#attributes, #rate_limit_info

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#[], #[]=, client, create, #delete, #initialize, #inspect, #method_missing, #reload, resource_name, #respond_to_missing?, search, #to_h, #to_json, #update

Constructor Details

This class inherits a constructor from Fathom::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Fathom::Resource

Class Method Details

.all(params = {}) ⇒ Array<TeamMember>

List all team members, optionally filtered by team name

Parameters:

  • params (Hash) (defaults to: {})

    Query parameters

Options Hash (params):

  • :team (String)

    Team name to filter by

  • :cursor (String)

    Cursor for pagination

Returns:



12
13
14
15
16
17
# File 'lib/fathom/resources/team_member.rb', line 12

def self.all(params = {})
  response = client.get(resource_path, params)
  data = response["items"] || []

  data.map { |attrs| new(attrs, rate_limit_info: client.rate_limiter.to_h) }
end

.resource_pathObject



5
# File 'lib/fathom/resources/team_member.rb', line 5

def self.resource_path = "team_members"

.retrieve(_id) ⇒ Object

Team members don’t have individual retrieve endpoint in the API Use .all with filters instead

Raises:

  • (NotImplementedError)


21
22
23
24
# File 'lib/fathom/resources/team_member.rb', line 21

def self.retrieve(_id)
  raise NotImplementedError,
        "TeamMember.retrieve is not supported by the Fathom API. Use TeamMember.all instead."
end

Instance Method Details

#created_atObject

Get the created_at timestamp



33
# File 'lib/fathom/resources/team_member.rb', line 33

def created_at = self["created_at"]

#emailObject

Get the member’s email



27
# File 'lib/fathom/resources/team_member.rb', line 27

def email = self["email"]

#idObject

Team members don’t have an ID field in the API



36
# File 'lib/fathom/resources/team_member.rb', line 36

def id = nil

#nameObject

Get the member’s name



30
# File 'lib/fathom/resources/team_member.rb', line 30

def name = self["name"]