kf5_api 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '086ce26787c30d276a9de72dff92b763db3c21aa'
4
- data.tar.gz: e119a89e89eecefedeb4958783baea8bfdd7d3b9
3
+ metadata.gz: 021bcb2f3706a298a1b08023f3940b9f9b2c78b0
4
+ data.tar.gz: e0114920cfe089c8df3a2a71f2966d955f7b2de4
5
5
  SHA512:
6
- metadata.gz: d095a03735399c502543ca7fced68bd14a600e616057395ae6306c3c91d3d16f3b3f3c8beec0155295bd7befa3e250f5d8f2ca9571370dc68fe037e6285bfaff
7
- data.tar.gz: d68ae8ffcb37d65230efca346ab3c483579a567e2ed8c48eb7102042553838ffddd4644d0d97b267078eaa2ade6574727eac2bde94bfbd5a9499b9cf207355b0
6
+ metadata.gz: f76300e19a6190c30510f03221f53fdf239126f52d403205d98dfb1e44c61a348415fa1d3c87ef8deb3e057dc50bac5db9549461078efffd55a5386813d8696b
7
+ data.tar.gz: b70113a6511e1bd9983cc2ae68d691616b20c0bfcbab7b9875d2f1fc9997b6ed5936292e19bacd7b3cd6407512e3960c85f41b7c3da4f35ee846edd7f9a05801
@@ -0,0 +1,31 @@
1
+ module Kf5Api
2
+ class UserField
3
+ extend Kf5Api::Base
4
+ private_class_method :new
5
+ # http://developer.kf5.com/restfulapi/core/user_fields/
6
+
7
+ ACTIONS_HASH = {
8
+ all: '/apiv2/user_fields',
9
+ active: '/apiv2/user_fields/active',
10
+ user_fields: '/apiv2/user_fields/%{id}'
11
+ }
12
+
13
+ class << self
14
+ # 用户自定义字段列表
15
+ def all(query_params = {})
16
+ get(ACTIONS_HASH[:all], query_params).parsed_response
17
+ end
18
+
19
+ # 获取状态为启用的自定义字段列表
20
+ def active(query_params = {})
21
+ get(ACTIONS_HASH[:active], query_params).parsed_response
22
+ end
23
+
24
+ # 查看用户自定义字段
25
+ def field_by_id(id)
26
+ action = format(ACTIONS_HASH[:user_fields], id: id)
27
+ get(action).parsed_response
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module Kf5Api
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/kf5_api.rb CHANGED
@@ -4,6 +4,7 @@ require "kf5_api/base"
4
4
  require "kf5_api/organization"
5
5
  require "kf5_api/user"
6
6
  require "kf5_api/kchat"
7
+ require "kf5_api/user_field"
7
8
  require "logger"
8
9
 
9
10
  module Kf5Api
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kf5_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - wangrui
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-30 00:00:00.000000000 Z
11
+ date: 2017-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -90,6 +90,7 @@ files:
90
90
  - lib/kf5_api/kchat.rb
91
91
  - lib/kf5_api/organization.rb
92
92
  - lib/kf5_api/user.rb
93
+ - lib/kf5_api/user_field.rb
93
94
  - lib/kf5_api/version.rb
94
95
  homepage: https://github.com/wangrui438/kf5_api
95
96
  licenses: