File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed
lib/active_model/serializer Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -26,26 +26,12 @@ class Serializer
26
26
# So you can inspect reflections in your Adapters.
27
27
#
28
28
Reflection = Struct . new ( :name , :options , :block ) do
29
- delegate :call , to : :reader
30
-
31
- attr_reader :reader
32
-
33
- def initialize ( *)
34
- super
35
- @reader = self . class . build_reader ( name , block )
36
- end
37
-
38
29
# @api private
39
30
def value ( instance )
40
- call ( instance )
41
- end
42
-
43
- # @api private
44
- def self . build_reader ( name , block )
45
31
if block
46
- -> ( instance ) { instance . read_attribute_for_serialization ( name ) . instance_eval ( &block ) }
32
+ instance . read_attribute_for_serialization ( name ) . instance_eval ( &block )
47
33
else
48
- -> ( instance ) { instance . read_attribute_for_serialization ( name ) }
34
+ instance . read_attribute_for_serialization ( name )
49
35
end
50
36
end
51
37
You can’t perform that action at this time.
0 commit comments