rest_framework 0.3.5 → 0.3.6

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
2
  SHA256:
3
- metadata.gz: dc5065eb969e4616e6a0e22717a4398940b3696a43182d6e8b526e225f6c81f3
4
- data.tar.gz: 3efcfdfa6abfe7343770c8241e83d34bc1e02bcbd145826bc8a9709514b8b5f7
3
+ metadata.gz: 86f1b6f94bf7074dd30cf16be9f07fdc83df2bd477e09584f12882456e1405cf
4
+ data.tar.gz: b0d8bacaac76492876f13e8f402bb090a3e490f3bbf6656c88efb3cf52d2d1c8
5
5
  SHA512:
6
- metadata.gz: 170b7b9ebb18b9527d1e9216a0456af154284ab8935d1ddcc367815bf73c86379ae83340f6a259f6b4324d5c4cf32eae740a28210a1ce963427ef96a870ae016
7
- data.tar.gz: a6148d463fa2eda9dc6f19dc89646a78b922a93bdcf6f147707343d218a9501e8bebe67d8182d75a946968d59b27a0f030d08349268297799bc4886b780f6aa4
6
+ metadata.gz: '02179633392aa9f9e7c873e38bcacfb1cd7c93b5caeef57c2ec112707b16fc069cae17686d899d4d6bf5cb0582dff469bac38e71081f7b5f20b5915298e6eb44'
7
+ data.tar.gz: 432da0162809905fc29e93194d616561ee0b9d93c23b194e77792fb9a7814062ae10025986c466510d3d5adfe2e4300de4104213444a30835626ed17c076f7b4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.5
1
+ 0.3.6
@@ -14,15 +14,3 @@ class RESTFramework::NilPassedToAPIResponseError < RESTFramework::Error
14
14
  MSG
15
15
  end
16
16
  end
17
-
18
-
19
- class RESTFramework::UnserializableError < RESTFramework::Error
20
- def initialize(object)
21
- @object = object
22
- return super
23
- end
24
-
25
- def message
26
- return "Unable to serialize `#{@object.inspect}` (of type `#{@object.class}`)."
27
- end
28
- end
@@ -105,18 +105,12 @@ class RESTFramework::NativeSerializer < RESTFramework::BaseSerializer
105
105
 
106
106
  # Convert the object (record or recordset) to Ruby primitives.
107
107
  def serialize
108
- if @object
109
- begin
110
- if @object.is_a?(Enumerable)
111
- return @object.map { |r| r.serializable_hash(self.get_serializer_config) }
112
- end
113
- return @object.serializable_hash(self.get_serializer_config)
114
- rescue NoMethodError
115
- end
116
- end
108
+ raise "No object available to serialize!" unless @object
117
109
 
118
- # Raise an error if we cannot serialize the object.
119
- raise RESTFramework::UnserializableError.new(@object)
110
+ if @object.is_a?(Enumerable)
111
+ return @object.map { |r| r.serializable_hash(self.get_serializer_config) }
112
+ end
113
+ return @object.serializable_hash(self.get_serializer_config)
120
114
  end
121
115
 
122
116
  # Allow a serializer instance to be used as a hash directly in a nested serializer config.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory N. Schmit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-07 00:00:00.000000000 Z
11
+ date: 2021-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails