Module: SmartHR::Client::DependentMethods

Included in:
SmartHR::Client
Defined in:
lib/smarthr/client/dependent_methods.rb

Instance Method Summary collapse

Instance Method Details

#create_crew_dependent(crew_id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash

Create a new crew dependent

Parameters:

  • crew_id (String)
  • body (Hash)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)

Returns:

  • (Hashie::Mash)

See Also:



82
83
84
# File 'lib/smarthr/client/dependent_methods.rb', line 82

def create_crew_dependent(crew_id:, body:, &block)
  post("/crews/#{crew_id}/dependents", body, &block)
end

#destroy_crew_dependent(crew_id:, id:) {|response_body, response_header| ... } ⇒ Object

Delete the crew dependent

Parameters:

  • crew_id (String)
  • id (String)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)

See Also:



12
13
14
# File 'lib/smarthr/client/dependent_methods.rb', line 12

def destroy_crew_dependent(crew_id:, id:, &block)
  delete("/crews/#{crew_id}/dependents/#{id}", &block)
end

#find_crew_dependent(crew_id:, id:) {|response_body, response_header| ... } ⇒ Hashie::Mash

Get the crew dependent

Parameters:

  • crew_id (String)
  • id (String)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)

Returns:

  • (Hashie::Mash)

See Also:



28
29
30
# File 'lib/smarthr/client/dependent_methods.rb', line 28

def find_crew_dependent(crew_id:, id:, &block)
  get("/crews/#{crew_id}/dependents/#{id}", &block)
end

#get_crew_dependents(crew_id:, page: 1, per_page: 10) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>

Get the list of crew dependents

Parameters:

  • crew_id (String)
  • page (Integer) (defaults to: 1)
  • per_page (Integer) (defaults to: 10)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Array<Hashie::Mash>)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)

Returns:

  • (Array<Hashie::Mash>)

See Also:



62
63
64
65
66
67
68
# File 'lib/smarthr/client/dependent_methods.rb', line 62

def get_crew_dependents(crew_id:, page: 1, per_page: 10, &block)
  get("/crews/#{crew_id}/dependents",
    page: page,
    per_page: per_page,
    &block
  )
end

#update_crew_dependent(crew_id:, id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash

Change the data of the specified crew dependent

Parameters:

  • crew_id (String)
  • id (String)
  • body (Hash)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)

Returns:

  • (Hashie::Mash)

See Also:



45
46
47
# File 'lib/smarthr/client/dependent_methods.rb', line 45

def update_crew_dependent(crew_id:, id:, body:, &block)
  patch("/crews/#{crew_id}/dependents/#{id}", body, &block)
end