@@ -59,46 +59,46 @@ def cache_hits # :nodoc:
59
59
@cache_hits ||= { }
60
60
end
61
61
62
- def render_template_to_object ( context , options ) # :nodoc:
63
- TemplateRenderer . new ( @lookup_context ) . render ( context , options )
64
- end
62
+ private
63
+ def render_template_to_object ( context , options )
64
+ TemplateRenderer . new ( @lookup_context ) . render ( context , options )
65
+ end
65
66
66
- def render_partial_to_object ( context , options , &block ) # :nodoc:
67
- partial = options [ :partial ]
68
- if String === partial
69
- collection = collection_from_options ( options )
67
+ def render_partial_to_object ( context , options , &block )
68
+ partial = options [ :partial ]
69
+ if String === partial
70
+ collection = collection_from_options ( options )
70
71
71
- if collection
72
- # Collection + Partial
73
- renderer = CollectionRenderer . new ( @lookup_context , options )
74
- renderer . render_collection_with_partial ( collection , partial , context , block )
75
- else
76
- if options . key? ( :object )
77
- # Object + Partial
78
- renderer = ObjectRenderer . new ( @lookup_context , options )
79
- renderer . render_object_with_partial ( options [ :object ] , partial , context , block )
72
+ if collection
73
+ # Collection + Partial
74
+ renderer = CollectionRenderer . new ( @lookup_context , options )
75
+ renderer . render_collection_with_partial ( collection , partial , context , block )
80
76
else
81
- # Partial
82
- renderer = PartialRenderer . new ( @lookup_context , options )
83
- renderer . render ( partial , context , block )
77
+ if options . key? ( :object )
78
+ # Object + Partial
79
+ renderer = ObjectRenderer . new ( @lookup_context , options )
80
+ renderer . render_object_with_partial ( options [ :object ] , partial , context , block )
81
+ else
82
+ # Partial
83
+ renderer = PartialRenderer . new ( @lookup_context , options )
84
+ renderer . render ( partial , context , block )
85
+ end
84
86
end
85
- end
86
- else
87
- collection = collection_from_object ( partial ) || collection_from_options ( options )
88
-
89
- if collection
90
- # Collection + Derived Partial
91
- renderer = CollectionRenderer . new ( @lookup_context , options )
92
- renderer . render_collection_derive_partial ( collection , context , block )
93
87
else
94
- # Object + Derived Partial
95
- renderer = ObjectRenderer . new ( @lookup_context , options )
96
- renderer . render_object_derive_partial ( partial , context , block )
88
+ collection = collection_from_object ( partial ) || collection_from_options ( options )
89
+
90
+ if collection
91
+ # Collection + Derived Partial
92
+ renderer = CollectionRenderer . new ( @lookup_context , options )
93
+ renderer . render_collection_derive_partial ( collection , context , block )
94
+ else
95
+ # Object + Derived Partial
96
+ renderer = ObjectRenderer . new ( @lookup_context , options )
97
+ renderer . render_object_derive_partial ( partial , context , block )
98
+ end
97
99
end
98
100
end
99
- end
100
101
101
- private
102
102
def collection_from_options ( options )
103
103
if options . key? ( :collection )
104
104
collection = options [ :collection ]
0 commit comments