Class: FjordBootCamp::Resources::Users

Inherits:
Base
  • Object
show all
Defined in:
lib/fjord_boot_camp/resources/users.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from FjordBootCamp::Resources::Base

Instance Method Details

#find(id) ⇒ Object

ユーザー詳細を取得

Parameters:

  • id (Integer)

    ユーザーID



24
25
26
# File 'lib/fjord_boot_camp/resources/users.rb', line 24

def find(id)
  get("/api/users/#{id}")
end

#list(target: nil, company_id: nil, tag: nil, page: nil) ⇒ Object

ユーザー一覧を取得

Parameters:

  • target (String, nil) (defaults to: nil)

    フィルタ (student, trainee, student_and_trainee, mentor, adviser, graduate等)

  • company_id (Integer, nil) (defaults to: nil)

    企業IDで絞り込み

  • tag (String, nil) (defaults to: nil)

    タグで絞り込み

  • page (Integer, nil) (defaults to: nil)

    ページ番号



13
14
15
16
17
18
19
20
# File 'lib/fjord_boot_camp/resources/users.rb', line 13

def list(target: nil, company_id: nil, tag: nil, page: nil)
  params = {}
  params[:target] = target if target
  params[:company_id] = company_id if company_id
  params[:tag] = tag if tag
  params[:page] = page if page
  get('/api/users', params)
end

#mentorsObject

メンター一覧を取得



34
35
36
# File 'lib/fjord_boot_camp/resources/users.rb', line 34

def mentors
  list(target: 'mentor')
end

#traineesObject

研修生一覧を取得



29
30
31
# File 'lib/fjord_boot_camp/resources/users.rb', line 29

def trainees
  list(target: 'trainee')
end