unimatrix 1.4.1 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/unimatrix/parser.rb +11 -3
- data/lib/unimatrix/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: f1e68de8a76b4c46e57bb9a3adb384ad30e45b4f
|
4
|
+
data.tar.gz: deec411e07b156ed1ee89866df7b565e8a0959df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f1306a188e70865219df2a12d3518ea28f655b1c697997add111c20322fb5d5349bedabe1f1fcf20c706e703f56d99c4bdeb7dce1ed657ab39b5b5e16e9c63
|
7
|
+
data.tar.gz: 8118a8d7dacd4b0563fde96f2ec335b50c07b56af7bda259c017a057d26f50fe40fc9e75d9d0e60f4cb2129aae6c49010686fc123b9f59635911a4f2431c3bfb
|
data/lib/unimatrix/parser.rb
CHANGED
@@ -99,10 +99,11 @@ module Unimatrix
|
|
99
99
|
if resource_attributes.present?
|
100
100
|
parse_nested_attributes( resource_attributes )
|
101
101
|
|
102
|
-
|
103
|
-
|
102
|
+
resource_class = find_resource_class_by_type_name(
|
103
|
+
resource_attributes[ 'type_name' ],
|
104
|
+
options[ 'type_name' ]
|
105
|
+
)
|
104
106
|
|
105
|
-
resource_class = Resource.find_by_type_name( resource_type_name )
|
106
107
|
if resource_class.present?
|
107
108
|
result = resource_class.new(
|
108
109
|
resource_attributes,
|
@@ -120,6 +121,13 @@ module Unimatrix
|
|
120
121
|
|
121
122
|
end
|
122
123
|
|
124
|
+
def find_resource_class_by_type_name( attribute_type_name, option_type_name )
|
125
|
+
resource_class = Resource.find_by_type_name( attribute_type_name )
|
126
|
+
unless resource_class.present?
|
127
|
+
resource_class = Resource.find_by_type_name( option_type_name )
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
123
131
|
def resource_associations_by( name, key )
|
124
132
|
result = Hash.new { | hash, key | hash[ key ] = [] }
|
125
133
|
associations = self.associations
|
data/lib/unimatrix/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unimatrix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jackson Souza
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.
|
173
|
+
rubygems_version: 2.5.2
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Unimatrix is used to communicate with Unimatrix APIs.
|