Class: Kf5Api::UserField

Inherits:
Object
  • Object
show all
Extended by:
Base
Defined in:
lib/kf5_api/user_field.rb

Constant Summary collapse

ACTIONS_HASH =
{
  all: '/apiv2/user_fields',
  active: '/apiv2/user_fields/active',
  user_fields: '/apiv2/user_fields/%{id}'
}

Class Method Summary collapse

Methods included from Base

basic_auth, get, put

Class Method Details

.active(query_params = {}) ⇒ Object

获取状态为启用的自定义字段列表



20
21
22
# File 'lib/kf5_api/user_field.rb', line 20

def active(query_params = {})
  get(ACTIONS_HASH[:active], query_params).parsed_response
end

.all(query_params = {}) ⇒ Object

用户自定义字段列表



15
16
17
# File 'lib/kf5_api/user_field.rb', line 15

def all(query_params = {})
  get(ACTIONS_HASH[:all], query_params).parsed_response
end

.field_by_id(id) ⇒ Object

查看用户自定义字段



25
26
27
28
# File 'lib/kf5_api/user_field.rb', line 25

def field_by_id(id)
  action = format(ACTIONS_HASH[:user_fields], id: id)
  get(action).parsed_response
end