chatwork 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chatwork/message.rb +1 -1
- data/lib/chatwork/operations.rb +12 -6
- data/lib/chatwork/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25204d174d123a033c044404f9c910d6241e5ff1
|
4
|
+
data.tar.gz: 69e0eae2716d3daf0e106aab1fa503adc963b209
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5b2e1d16fb62d7d060d30e829cf870e820912cf18ecb82c6d517270967238541ca3b2583d693352dcdb2f73f0710095ac3cd0cc5f4985a05fd9ca4508216b49
|
7
|
+
data.tar.gz: d99e7c85eafec243c9125d394b8f9fc9160565154a8dcf8a9f2b469fcf07dad048a7eeed8751b4adae488c24665eb7fee8a5fac1c553ddd3d45c49439afe5844
|
data/lib/chatwork/message.rb
CHANGED
data/lib/chatwork/operations.rb
CHANGED
@@ -8,7 +8,8 @@ module ChatWork
|
|
8
8
|
def define_get
|
9
9
|
instance_eval do
|
10
10
|
def get(params = {})
|
11
|
-
|
11
|
+
assign_path = parse_if_hash_key_exists(path, params, :room_id)
|
12
|
+
convert(ChatWork.client.get(assign_path, params))
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
@@ -18,14 +19,19 @@ module ChatWork
|
|
18
19
|
def create(params = {})
|
19
20
|
# TODO: Consider other pattern
|
20
21
|
# /rooms and /rooms/:room_id
|
21
|
-
assign_path =
|
22
|
-
path % params.delete(:room_id)
|
23
|
-
else
|
24
|
-
path
|
25
|
-
end
|
22
|
+
assign_path = parse_if_hash_key_exists(path, params, :room_id)
|
26
23
|
convert(ChatWork.client.post(assign_path, params))
|
27
24
|
end
|
28
25
|
end
|
29
26
|
end
|
27
|
+
|
28
|
+
private
|
29
|
+
def parse_if_hash_key_exists(string, hash, key)
|
30
|
+
if hash.include?(key)
|
31
|
+
string % hash.delete(key)
|
32
|
+
else
|
33
|
+
string
|
34
|
+
end
|
35
|
+
end
|
30
36
|
end
|
31
37
|
end
|
data/lib/chatwork/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chatwork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- asonas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -118,3 +118,4 @@ summary: Ruby bindings of Chatwork API
|
|
118
118
|
test_files:
|
119
119
|
- spec/lib/chatwork_spec.rb
|
120
120
|
- spec/spec_helper.rb
|
121
|
+
has_rdoc:
|