restful-sharepoint 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/restful-sharepoint/common-base.rb +7 -4
- data/lib/restful-sharepoint/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2ca679f36d66daff66ceeb2fd5729912c2456d3278ada4b48c3fe699156304c6
|
4
|
+
data.tar.gz: 3e6b945bdc955541eeb15a99c573332b94008b898abd4bde1caaee34a672b3e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e497de459b6591614650fd1166a62db1563bd79cd5c733ab735b43e502955400f58c070bccf6aa6126bba82dcbd17b1ba89c4665dd9e3562e6060925718abb26
|
7
|
+
data.tar.gz: a75b83c704266a223be6e820775cc0f6a39ea60d11c5942ab91d9f351ce83eafe733c8a58d6c4364837085fa78fe59ca9c0b415e7aa64c3c686c2e2ee12f52bd
|
@@ -2,13 +2,16 @@ module RestfulSharePoint
|
|
2
2
|
class CommonBase
|
3
3
|
# Converts the given enumerable tree to a collection or object.
|
4
4
|
def objectify(tree)
|
5
|
+
klass = nil
|
5
6
|
if tree['results'] && !tree['results'].empty?
|
6
|
-
type = tree.dig('__metadata', 'type') || tree.dig('results', 0, '__metadata', 'type')
|
7
|
-
|
7
|
+
if type = tree.dig('__metadata', 'type') || tree.dig('results', 0, '__metadata', 'type')
|
8
|
+
pattern, klass = COLLECTION_MAP.find { |pattern,| pattern.match(type) }
|
9
|
+
end
|
8
10
|
klass ? RestfulSharePoint.const_get(klass).new(parent: self, collection: tree['results']) : tree['results']
|
9
11
|
elsif tree['__metadata']
|
10
|
-
type = tree['__metadata']['type']
|
11
|
-
|
12
|
+
if type = tree['__metadata']['type']
|
13
|
+
pattern, klass = OBJECT_MAP.find { |pattern,| pattern.match(type) }
|
14
|
+
end
|
12
15
|
klass ? RestfulSharePoint.const_get(klass).new(parent: self, properties: tree) : tree
|
13
16
|
end
|
14
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restful-sharepoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Wardrop
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpi
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.
|
88
|
+
rubygems_version: 2.7.3
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: Provides a convenient object model to the OData REST API of SharePoint 2013
|