Module: SmartHR::Client::CrewMethods
- Included in:
- SmartHR::Client
- Defined in:
- lib/smarthr/client/crew_methods.rb
Instance Method Summary collapse
-
#create_crew(body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Create a new crew.
-
#destroy_crew(id:) {|response_body, response_header| ... } ⇒ Object
Delete the crew.
-
#destroy_crew_departments(crew_id:) {|response_body, response_header| ... } ⇒ Object
Delete the crew departments.
-
#find_crew(id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Get the crew.
-
#get_crews(page: 1, per_page: 10, emp_code: nil, emp_type: nil, emp_status: nil, gender: nil, sort: nil, entered_at_from: nil, entered_at_to: nil, q: nil, fields: []) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>
Get the list of crew custom field template groups.
-
#invite_crew(id:, invite_user_id:, crew_input_form_id: nil) {|response_body, response_header| ... } ⇒ Hashie::Mash
Invite a crew.
-
#update_crew(id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Change the data of the specified crew.
Instance Method Details
#create_crew(body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Create a new crew
116 117 118 |
# File 'lib/smarthr/client/crew_methods.rb', line 116 def create_crew(body:, &block) post("/crews", body, &block) end |
#destroy_crew(id:) {|response_body, response_header| ... } ⇒ Object
Delete the crew
32 33 34 |
# File 'lib/smarthr/client/crew_methods.rb', line 32 def destroy_crew(id:, &block) delete("/crews/#{id}", &block) end |
#destroy_crew_departments(crew_id:) {|response_body, response_header| ... } ⇒ Object
Delete the crew departments
129 130 131 |
# File 'lib/smarthr/client/crew_methods.rb', line 129 def destroy_crew_departments(crew_id:, &block) delete("/crews/#{crew_id}/departments", &block) end |
#find_crew(id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Get the crew
47 48 49 |
# File 'lib/smarthr/client/crew_methods.rb', line 47 def find_crew(id:, &block) get("/crews/#{id}", &block) end |
#get_crews(page: 1, per_page: 10, emp_code: nil, emp_type: nil, emp_status: nil, gender: nil, sort: nil, entered_at_from: nil, entered_at_to: nil, q: nil, fields: []) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>
Get the list of crew custom field template groups
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/smarthr/client/crew_methods.rb', line 88 def get_crews(page: 1, per_page: 10, emp_code: nil, emp_type: nil, emp_status: nil, gender: nil, sort: nil, entered_at_from: nil, entered_at_to: nil, q: nil, fields: [], &block) get("/crews", page: page, per_page: per_page, emp_code: emp_code, emp_type: emp_type, emp_status: emp_status, gender: gender, sort: sort, entered_at_from: entered_at_from, entered_at_to: entered_at_to, q: q, fields: fields.join(','), &block ) end |
#invite_crew(id:, invite_user_id:, crew_input_form_id: nil) {|response_body, response_header| ... } ⇒ Hashie::Mash
Invite a crew
15 16 17 18 19 20 21 |
# File 'lib/smarthr/client/crew_methods.rb', line 15 def invite_crew(id:, invite_user_id:, crew_input_form_id: nil, &block) put("/crews/#{id}/invite", invite_user_id: invite_user_id, crew_input_form_id: crew_input_form_id, &block ) end |
#update_crew(id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Change the data of the specified crew
63 64 65 |
# File 'lib/smarthr/client/crew_methods.rb', line 63 def update_crew(id:, body:, &block) patch("/crews/#{id}", body, &block) end |