safen 0.1.0 → 0.1.1

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: 17a10cc0c9cfacaa50984aa85ca92507361975d1
4
- data.tar.gz: faf894f100c853dbd9a72c32b7364fcbe7756f0b
3
+ metadata.gz: 4569e75731c5e071f1c3c376ca6cebc4a9332a05
4
+ data.tar.gz: b32369b201927ac65caf772e75f2e50808a95d15
5
5
  SHA512:
6
- metadata.gz: 188d2c54068b41b1a0d120b78c24db0e697e161b2893c43462294ca16d441a0cdb4c31d7a93de8619adbd70ba41815be5f31f40d8ceebc78eb1851ffab45f5c9
7
- data.tar.gz: aa9e2d62f739dcea36baee8114c34c041327ad7e19a9914430995e271af3275caa844688b842c8165150dea2864791b2d8f616d79d8001290ce330f75b4beeb7
6
+ metadata.gz: 10468d9b404b8b88026320c41b773c70bfd074951dbc29cdb0c9146e8c0687418f5806a5c0e9b2562b280dcc51381d54b5d572386e61404fb9b1b2e32bfbe91c
7
+ data.tar.gz: 5c80aeecaa5cd8f7b16431b0f506dd470983d72bda884d834952563c9ddbdeb5e86234c05b1dad834ec85c6d375a81ae778319bdef3edc3342f4c57a8abeec0c
data/README.md CHANGED
@@ -38,14 +38,15 @@ Safen.new('xxxx', ['xxx.xxx.xxx.xxx:xxxx']).create old_tel_num, group_code
38
38
  ### 수정 요청
39
39
 
40
40
  ```
41
- Safen.new('xxxx', ['xxx.xxx.xxx.xxx:xxxx']).update old_tel_num, group_code, new_tel_num
41
+ Safen.new('xxxx', ['xxx.xxx.xxx.xxx:xxxx']).update old_tel_num, new_old_tel_num, group_code, new_tel_num
42
42
  ```
43
43
 
44
44
  **params**
45
45
 
46
- - `old_tel_num`: 실제 사용중인 착신번호
46
+ - `old_tel_num`: 기존 착신번호
47
+ - `new_old_tel_num`: 신규 착신번호
47
48
  - `group_code`: 그룹코드
48
- - `new_tel_num`: 맵핑할 번호
49
+ - `new_tel_num`: 0504 맵핑할 번호
49
50
 
50
51
  **ret**
51
52
 
data/lib/safen.rb CHANGED
@@ -74,13 +74,14 @@ class Safen
74
74
  end
75
75
 
76
76
  # 수정 요청
77
- # @param old_tel_num [String] 실제 사용중인 착신번호
77
+ # @param old_tel_num [String] 기존 착신번호 (고객사에서 관리하는 경우 신규시 1234567890)
78
+ # @param new_old_tel_num [String] 신규 착신번호 (고객사에서 관리하는 경우 수정시 1234567890)
78
79
  # @param group_code [String] 그룹코드
79
80
  # @param new_tel_num [String] 매핑할 번호
80
81
  # @return [bool] 성공여부
81
- def update(old_tel_num, group_code, new_tel_num)
82
+ def update(old_tel_num, new_old_tel_num, group_code, new_tel_num)
82
83
  header = Header.mapping_update_request(@corp_code)
83
- body = Body.mapping_update_request(old_tel_num, new_tel_num, group_code)
84
+ body = Body.mapping_update_request(old_tel_num, new_old_tel_num, group_code, new_tel_num)
84
85
 
85
86
  code, data = call_api(header, body)
86
87
 
data/lib/safen/body.rb CHANGED
@@ -15,15 +15,15 @@ class Safen
15
15
  end
16
16
 
17
17
  # 전화번호 매핑 수정
18
- def mapping_update_request(old_tel_num, new_tel_num, group_code)
19
- default_old_tel_num = '1234567890'
18
+ def mapping_update_request(old_tel_num, new_old_tel_num, group_code, new_tel_num)
19
+ new_old_tel_num_nomalize = new_old_tel_num.gsub(/-/, '')
20
20
  old_tel_num_nomalize = old_tel_num.gsub(/-/, '')
21
21
  new_tel_num_nomalize = new_tel_num.gsub(/-/, '')
22
22
 
23
23
  ret = ''
24
24
  ret += "#{new_tel_num_nomalize.ljust(20, ' ')}"
25
- ret += "#{default_old_tel_num.ljust(20, ' ')}#{old_tel_num_nomalize.ljust(20, ' ')}"
26
- ret += "#{default_old_tel_num.ljust(20, ' ')}#{old_tel_num_nomalize.ljust(20, ' ')}"
25
+ ret += "#{old_tel_num_nomalize.ljust(20, ' ')}#{new_old_tel_num_nomalize.ljust(20, ' ')}"
26
+ ret += "#{old_tel_num_nomalize.ljust(20, ' ')}#{new_old_tel_num_nomalize.ljust(20, ' ')}"
27
27
  ret += "#{group_code.ljust(10, ' ')}"
28
28
  ret += "#{' ' * 50}#{' ' * 10}"
29
29
 
data/lib/safen/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Safen
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - subicura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-01 00:00:00.000000000 Z
11
+ date: 2017-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler