mindmatch 0.1.2 → 0.2.2

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
- SHA1:
3
- metadata.gz: 0e392da27fe12801821e52e5c38e557e009f2422
4
- data.tar.gz: 8f969573c319d9754870bd73080dad4d0aa6e036
2
+ SHA256:
3
+ metadata.gz: 38c03675c4fe4d47aacb38f1372a6511a8e594deb195cfc44b2454df751fc305
4
+ data.tar.gz: 7a4f96f60c9c310c8a9c5af9ea20fc58e881b7b8c68ed2892dd086aecd62e373
5
5
  SHA512:
6
- metadata.gz: 1aa6e0ca21d9c99500bdf5c67419aaaa095065473a76a1861d81ecd6e536a3eb0e1f420a7e29df9ec08899eccaf565971d12ad1bf8be9311d8fda193ad7ef5d4
7
- data.tar.gz: aeca7c427ac3c0374e52f887714a37b857e4b052a02ddaab260f2854de62cfa0c64a005cd5fbde9f7be1d1172afbfa5d6a1c36c6ad50aaffbb1f06d596c928b6
6
+ metadata.gz: f221ed3523a9e92915cb563b621a31b1448e712c40256ce997b4899fedbffe74cf67ca7958db14a1e58e3e3b917a08051eaff98bda72171fb433833373c92414
7
+ data.tar.gz: c6033f61d76a2baad0aed572780b8ebe6b652951ddbbccc1335e5e02d65da2a9e5dd8bfe54e8967b3b2102d349a61ffa9d093fbf3bbdb185af022778f7b81995
@@ -18,8 +18,8 @@ module MindMatch
18
18
  def to_s
19
19
  ''.tap do |s|
20
20
  fields.each do |k, v|
21
- s << "#{k} {\n"
22
- s << v.join("\n")
21
+ s << "#{k} {"
22
+ s << join(v)
23
23
  s << "}\n"
24
24
  end
25
25
  end
@@ -29,6 +29,23 @@ module MindMatch
29
29
 
30
30
  attr_reader :fields
31
31
 
32
+ def join(v)
33
+ v.each_with_object('') do |f, s|
34
+ case f
35
+ when Hash
36
+ f.each do |key, value|
37
+ s << "\n" unless s.end_with?("\n")
38
+ s << "#{key} {"
39
+ s << join(value)
40
+ s << "}"
41
+ end
42
+ else
43
+ s << "\n" unless s.end_with?("\n")
44
+ s << f.to_s
45
+ end
46
+ end
47
+ end
48
+
32
49
  def method_missing(m, *args, &block)
33
50
  method = m.to_s
34
51
  if method.start_with?('with_')
@@ -1,3 +1,3 @@
1
1
  module MindMatch
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mindmatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - MindMatch
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2017-11-02 00:00:00.000000000 Z
13
+ date: 2017-11-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.5.2
143
+ rubygems_version: 2.7.2
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: MindMatch api client library for Ruby