Module: SmartHR::Client::DepartmentMethods
- Included in:
- SmartHR::Client
- Defined in:
- lib/smarthr/client/department_methods.rb
Instance Method Summary collapse
-
#create_department(body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Create a new department.
-
#destroy_department(id:) {|response_body, response_header| ... } ⇒ Object
Delete the department.
-
#find_department(id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Get the department.
-
#get_departments(page: 1, per_page: 10, code: nil, sort: nil) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>
Get the list of departments.
-
#update_department(id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Change the data of the specified department.
Instance Method Details
#create_department(body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Create a new department
81 82 83 |
# File 'lib/smarthr/client/department_methods.rb', line 81 def create_department(body:, &block) post("/departments", body, &block) end |
#destroy_department(id:) {|response_body, response_header| ... } ⇒ Object
Delete the department
11 12 13 |
# File 'lib/smarthr/client/department_methods.rb', line 11 def destroy_department(id:, &block) delete("/departments/#{id}", &block) end |
#find_department(id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Get the department
26 27 28 |
# File 'lib/smarthr/client/department_methods.rb', line 26 def find_department(id:, &block) get("/departments/#{id}", &block) end |
#get_departments(page: 1, per_page: 10, code: nil, sort: nil) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>
Get the list of departments
60 61 62 63 64 65 66 67 68 |
# File 'lib/smarthr/client/department_methods.rb', line 60 def get_departments(page: 1, per_page: 10, code: nil, sort: nil, &block) get("/departments", page: page, per_page: per_page, code: code, sort: sort, &block ) end |
#update_department(id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Change the data of the specified department
42 43 44 |
# File 'lib/smarthr/client/department_methods.rb', line 42 def update_department(id:, body:, &block) patch("/departments/#{id}", body, &block) end |