streamingly 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/streamingly/serde.rb +5 -1
- data/lib/streamingly/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 457684ce6e8d5dcbfcdd75109553506abad640f0
|
4
|
+
data.tar.gz: c6164ac662cac7e76bde51fed2815b70dbeb3d70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 349c229ca5a8e0d843675b472232331d23d98ddd4570fcbeb18c1d9e09ef35d188252ab550aca1f42ec5208b437f35dfa99b961f7f81dcad9d1e1200c746813d
|
7
|
+
data.tar.gz: 576499b30eca318bea397c193321003f1e896ff9127425e48e24a4d1488deafbc92e017165810973c05787a75330aaa7e92a9babe548c081d105419b018465a2
|
data/lib/streamingly/serde.rb
CHANGED
@@ -26,8 +26,12 @@ module Streamingly
|
|
26
26
|
|
27
27
|
def self.from_csv(string)
|
28
28
|
tokens = CSV.parse_line(string)
|
29
|
+
return unless tokens.size > 0
|
29
30
|
klass = resolve_class(tokens.first)
|
30
|
-
|
31
|
+
tokens_arr = tokens.to_a
|
32
|
+
tokens_arr.pop while tokens_arr.last.nil?
|
33
|
+
tokens_arr.shift # Remove leading class marker
|
34
|
+
klass.new(*tokens_arr)
|
31
35
|
rescue NameError
|
32
36
|
tokens
|
33
37
|
end
|
data/lib/streamingly/version.rb
CHANGED