type_struct 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/type_struct/generator.rb +5 -1
- data/lib/type_struct/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c4980fad4adaa9e864b7e7d61b4561687b945a6
|
4
|
+
data.tar.gz: 69fc7fbad59d06eba7033574877a5cd3f29d162a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb6f91c7ab75daa59bbe963ed1402a7ca40967923cbddf9ff3d28be8cb21f4c5f5f59c80ea6be0bf911c4cfc014002ff05922bcd42c55dae807a9853363e0657
|
7
|
+
data.tar.gz: 60c49aee26de2c1269ce60d92ba15d7ec53ff13d22b843d340ef468e4346de2bdc555d33e34a1cb8dd4457ea08285b2206d133d9b8e3355db6bda54e57334b70
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class TypeStruct
|
2
4
|
# Respects:
|
3
5
|
# http://json2struct.mervine.net/
|
@@ -41,10 +43,12 @@ class TypeStruct
|
|
41
43
|
if value.empty?
|
42
44
|
"Hash"
|
43
45
|
else
|
44
|
-
type_struct = key.to_s.gsub(/
|
46
|
+
type_struct = key.to_s.gsub(/s\z/, '').split('_').map(&:capitalize).join
|
45
47
|
parse(type_struct, value)
|
46
48
|
type_struct
|
47
49
|
end
|
50
|
+
when Fixnum, Bignum
|
51
|
+
"Integer"
|
48
52
|
when NilClass
|
49
53
|
"Object"
|
50
54
|
when TrueClass, FalseClass
|
data/lib/type_struct/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: type_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ksss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
99
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
100
|
+
rubygems_version: 2.4.5.1
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: Pseudo type system on struct.
|