Class: Dotloop::Employee

Inherits:
Object
  • Object
show all
Defined in:
lib/dotloop/employee.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Employee

Returns a new instance of Employee.



5
6
7
# File 'lib/dotloop/employee.rb', line 5

def initialize(client:)
  @client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



3
4
5
# File 'lib/dotloop/employee.rb', line 3

def client
  @client
end

Instance Method Details

#all(profile_id:) ⇒ Object



9
10
11
12
# File 'lib/dotloop/employee.rb', line 9

def all(profile_id:)
  url = "/profile/#{profile_id.to_i}/employee"
  @client.get(url).map { |employee_attrs| Dotloop::Models::Employee.new(employee_attrs) }
end