garoon-cat 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0a316bfd31a07b5fcd2cadd8f559695edbcd63d7
4
- data.tar.gz: a7f01841d167a1ac1e66aa8dd4c8a175828e23ed
2
+ SHA256:
3
+ metadata.gz: 57466ae36f71941f3142c515313fdcb409ec27c8c59a9d8b8dfb9d8948797250
4
+ data.tar.gz: 27679ed43ae44e6e329025a02b5f711720e830f400ce9ef41a176beb463ebcf1
5
5
  SHA512:
6
- metadata.gz: e81bedce68ab3edf2320f7d1331c0c1f8badfc8695b7f020cafecce6e033b80567dc783f391f21061c5a959451a2a91ecdf65e811df53d2ab5bd8b7e88a4cdc4
7
- data.tar.gz: 04b547e551d6e5dbb0e03adfc7d649ecf5348d98fa7c29b6724599f2b382f12c2fb2178eb5176c454e4874bf16dc8d51089031d31cd259bfd0d9877f7d826e47
6
+ metadata.gz: d66efd8fd5dd5984eae0d30fcc9959c3c5d7908e9ceda8676bc2b1bff7664ff61ff0c4d806246a743f63af5b4e7b274bc360bfa133caa4cc169a2f903c0cb217
7
+ data.tar.gz: 8d1cce2ce6f5479906aa363b6efff6b95e21d79a434151f38adc080bb2168c86cf517a0e4bb48a6fcbfe031697da612aea1b70940690138ae5615d75c3c2665e
data/README.md CHANGED
@@ -135,7 +135,7 @@ $ cat orgs.json | head
135
135
  "version": "0000000000",
136
136
  "organization": [
137
137
  {
138
- "key": "2",
138
+ "key": "2",
139
139
  ```
140
140
 
141
141
  ## Development
@@ -149,7 +149,7 @@ export PASSWORD=password
149
149
  ```
150
150
 
151
151
  ```bash
152
- bundle exec rake test
152
+ $ bundle exec rake test
153
153
  ```
154
154
 
155
155
  ```bash
@@ -57,10 +57,10 @@ class GaroonCat::Request
57
57
  target.each do |key, v1|
58
58
  case v1
59
59
  when String
60
- parameters.add_element(key.to_s).add_text(v1.to_s)
60
+ add_attribute_or_element!(parameters, key, v1)
61
61
  when Array
62
62
  v1.each do |v2|
63
- parameters.add_element(key.to_s).add_text(v2.to_s)
63
+ add_attribute_or_element!(parameters, key, v2)
64
64
  end
65
65
  end
66
66
  end
@@ -99,4 +99,17 @@ class GaroonCat::Request
99
99
  doc.to_s
100
100
  end
101
101
 
102
+ private
103
+
104
+ # @param element [REXML::Element]
105
+ # @param key [String, Symbol]
106
+ # @param value [String]
107
+ def add_attribute_or_element!(element, key, value)
108
+ if key[0] == "@"
109
+ element.root.add_attribute(key[1..-1].to_s, value)
110
+ else
111
+ element.add_element(key.to_s).add_text(value.to_s)
112
+ end
113
+ end
114
+
102
115
  end
@@ -1,3 +1,3 @@
1
1
  class GaroonCat
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garoon-cat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masayuki Higashino
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-18 00:00:00.000000000 Z
11
+ date: 2018-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -282,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
282
  version: '0'
283
283
  requirements: []
284
284
  rubyforge_project:
285
- rubygems_version: 2.6.8
285
+ rubygems_version: 2.7.6
286
286
  signing_key:
287
287
  specification_version: 4
288
288
  summary: 'Garoon Cat: A Ruby interface to the Garoon API.'