yamwow 0.0.13 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
@@ -15,9 +15,9 @@ module YamWow
|
|
15
15
|
def get_messages_with_praise_topic
|
16
16
|
r = MessagesWithTopicRequest.new(@client, 'praise', @options).send
|
17
17
|
r.data.each do |m|
|
18
|
-
m['
|
19
|
-
m['
|
20
|
-
m['
|
18
|
+
m['praise_message'] = reason m
|
19
|
+
m['praise_recipient_names'] = recipient_names m
|
20
|
+
m['praise_recipient_tags'] = recipient_tags m
|
21
21
|
end
|
22
22
|
r
|
23
23
|
end
|
data/lib/yamwow/response.rb
CHANGED
@@ -12,8 +12,7 @@ module YamWow
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def to_csv(options={})
|
15
|
-
|
16
|
-
hashes = data.map { |h| h.flatten_with_path }
|
15
|
+
hashes = flatten_data
|
17
16
|
columns = options[:include]
|
18
17
|
|
19
18
|
unless columns
|
@@ -31,5 +30,23 @@ module YamWow
|
|
31
30
|
end
|
32
31
|
end
|
33
32
|
|
33
|
+
def to_s(template=nil)
|
34
|
+
return super unless template
|
35
|
+
keys = template.scan(/(\{(.+?)\})/m)
|
36
|
+
results = flatten_data.map do |h|
|
37
|
+
t = "#{template}"
|
38
|
+
keys.each { |k| t.gsub! k[0], h[k[1]].to_s.gsub("\n", ' ') }
|
39
|
+
t
|
40
|
+
end
|
41
|
+
results.join
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def flatten_data
|
47
|
+
data = @data.kind_of?(Array) ? @data : [@data]
|
48
|
+
data.map { |h| h.flatten_with_path }
|
49
|
+
end
|
50
|
+
|
34
51
|
end
|
35
52
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yamwow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yam
|
16
|
-
requirement: &
|
16
|
+
requirement: &70202395055020 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70202395055020
|
25
25
|
description:
|
26
26
|
email: matthew-github@matthewriley.name
|
27
27
|
executables: []
|