restful-sharepoint 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ca5a6d79134a919eb106740ee9c59cdb2f5d08bc
4
- data.tar.gz: 83b3941a678cb3da05dc7f4068bb5c51ff01c538
2
+ SHA256:
3
+ metadata.gz: 2ca679f36d66daff66ceeb2fd5729912c2456d3278ada4b48c3fe699156304c6
4
+ data.tar.gz: 3e6b945bdc955541eeb15a99c573332b94008b898abd4bde1caaee34a672b3e5
5
5
  SHA512:
6
- metadata.gz: 6bf90465124a3eb773e56bf541057f8e2c927c5ccd57e07ab4a4b82d71d5d1f38dfa946717bfc2bdf392f1a575e05372c395a2dddce50b1bb40281858461bf17
7
- data.tar.gz: cc7ddbb03f5effef14684a74bcc9599e6f77cfb8e95a9958b2877aeac247da9532c6dcc4ab108824714ae930847b5575246816277edfff3b13f7d8c1c8eb2a1d
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
- pattern, klass = COLLECTION_MAP.find { |pattern,| pattern.match(type) }
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
- pattern, klass = OBJECT_MAP.find { |pattern,| pattern.match(type) }
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
@@ -1,3 +1,3 @@
1
1
  module RestfulSharePoint
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  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.3
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: 2017-11-02 00:00:00.000000000 Z
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.6.12
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