1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < meta charset ="utf-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title >
7+ Module: SnakyHash::Serializer::BackportedInstanceMethods
8+
9+ — Documentation by YARD 0.9.37
10+
11+ </ title >
12+
13+ < link rel ="stylesheet " href ="../../css/style.css " type ="text/css " />
14+
15+ < link rel ="stylesheet " href ="../../css/common.css " type ="text/css " />
16+
17+ < script type ="text/javascript ">
18+ pathId = "SnakyHash::Serializer::BackportedInstanceMethods" ;
19+ relpath = '../../' ;
20+ </ script >
21+
22+
23+ < script type ="text/javascript " charset ="utf-8 " src ="../../js/jquery.js "> </ script >
24+
25+ < script type ="text/javascript " charset ="utf-8 " src ="../../js/app.js "> </ script >
26+
27+
28+ </ head >
29+ < body >
30+ < div class ="nav_wrap ">
31+ < iframe id ="nav " src ="../../class_list.html?1 "> </ iframe >
32+ < div id ="resizer "> </ div >
33+ </ div >
34+
35+ < div id ="main " tabindex ="-1 ">
36+ < div id ="header ">
37+ < div id ="menu ">
38+
39+ < a href ="../../_index.html "> Index (B)</ a > »
40+ < span class ='title '> < span class ='object_link '> < a href ="../../SnakyHash.html " title ="SnakyHash (module) "> SnakyHash</ a > </ span > </ span > » < span class ='title '> < span class ='object_link '> < a href ="../Serializer.html " title ="SnakyHash::Serializer (module) "> Serializer</ a > </ span > </ span >
41+ »
42+ < span class ="title "> BackportedInstanceMethods</ span >
43+
44+ </ div >
45+
46+ < div id ="search ">
47+
48+ < a class ="full_list_link " id ="class_list_link "
49+ href ="../../class_list.html ">
50+
51+ < svg width ="24 " height ="24 ">
52+ < rect x ="0 " y ="4 " width ="24 " height ="4 " rx ="1 " ry ="1 "> </ rect >
53+ < rect x ="0 " y ="12 " width ="24 " height ="4 " rx ="1 " ry ="1 "> </ rect >
54+ < rect x ="0 " y ="20 " width ="24 " height ="4 " rx ="1 " ry ="1 "> </ rect >
55+ </ svg >
56+ </ a >
57+
58+ </ div >
59+ < div class ="clear "> </ div >
60+ </ div >
61+
62+ < div id ="content "> < h1 > Module: SnakyHash::Serializer::BackportedInstanceMethods
63+
64+
65+
66+ </ h1 >
67+ < div class ="box_info ">
68+
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+
79+ < dl >
80+ < dt > Defined in:</ dt >
81+ < dd > lib/snaky_hash/serializer.rb</ dd >
82+ </ dl >
83+
84+ </ div >
85+
86+
87+
88+
89+
90+
91+
92+
93+
94+ < h2 >
95+ Instance Method Summary
96+ < small > < a href ="# " class ="summary_toggle "> collapse</ a > </ small >
97+ </ h2 >
98+
99+ < ul class ="summary ">
100+
101+ < li class ="public ">
102+ < span class ="summary_signature ">
103+
104+ < a href ="#transform_values-instance_method " title ="#transform_values (instance method) "> #< strong > transform_values</ strong > (&block) ⇒ Object </ a >
105+
106+
107+
108+ </ span >
109+
110+
111+
112+
113+
114+
115+
116+
117+
118+ < span class ="summary_desc "> < div class ='inline '> < p > :nocov: This will be run in CI on Ruby 2.3, but we only collect coverage from current Ruby Rails <= 5.2 had a transform_values method, which was added to Ruby in version 2.4.</ p >
119+ </ div > </ span >
120+
121+ </ li >
122+
123+
124+ </ ul >
125+
126+
127+
128+
129+ < div id ="instance_method_details " class ="method_details_list ">
130+ < h2 > Instance Method Details</ h2 >
131+
132+
133+ < div class ="method_details first ">
134+ < h3 class ="signature first " id ="transform_values-instance_method ">
135+
136+ #< strong > transform_values</ strong > (&block) ⇒ < tt > Object</ tt >
137+
138+
139+
140+
141+
142+ </ h3 > < div class ="docstring ">
143+ < div class ="discussion ">
144+ < p > :nocov:< br />
145+ This will be run in CI on Ruby 2.3, but we only collect coverage from current Ruby< br />
146+ Rails <= 5.2 had a transform_values method, which was added to Ruby in version 2.4.< br />
147+ This method is a backport of that original Rails method for Ruby 2.2 and 2.3.</ p >
148+
149+
150+ </ div >
151+ </ div >
152+ < div class ="tags ">
153+
154+
155+ </ div > < table class ="source_code ">
156+ < tr >
157+ < td >
158+ < pre class ="lines ">
159+
160+
161+ 57
162+ 58
163+ 59
164+ 60
165+ 61
166+ 62
167+ 63
168+ 64
169+ 65</ pre >
170+ </ td >
171+ < td >
172+ < pre class ="code "> < span class ="info file "> # File 'lib/snaky_hash/serializer.rb', line 57</ span >
173+
174+ < span class ='kw '> def</ span > < span class ='id identifier rubyid_transform_values '> transform_values</ span > < span class ='lparen '> (</ span > < span class ='op '> &</ span > < span class ='id identifier rubyid_block '> block</ span > < span class ='rparen '> )</ span >
175+ < span class ='kw '> return</ span > < span class ='id identifier rubyid_enum_for '> enum_for</ span > < span class ='lparen '> (</ span > < span class ='symbol '> :transform_values</ span > < span class ='rparen '> )</ span > < span class ='lbrace '> {</ span > < span class ='id identifier rubyid_size '> size</ span > < span class ='rbrace '> }</ span > < span class ='kw '> unless</ span > < span class ='id identifier rubyid_block_given? '> block_given?</ span >
176+ < span class ='kw '> return</ span > < span class ='lbrace '> {</ span > < span class ='rbrace '> }</ span > < span class ='kw '> if</ span > < span class ='id identifier rubyid_empty? '> empty?</ span >
177+ < span class ='id identifier rubyid_result '> result</ span > < span class ='op '> =</ span > < span class ='kw '> self</ span > < span class ='period '> .</ span > < span class ='id identifier rubyid_class '> class</ span > < span class ='period '> .</ span > < span class ='id identifier rubyid_new '> new</ span >
178+ < span class ='id identifier rubyid_each '> each</ span > < span class ='kw '> do</ span > < span class ='op '> |</ span > < span class ='id identifier rubyid_key '> key</ span > < span class ='comma '> ,</ span > < span class ='id identifier rubyid_value '> value</ span > < span class ='op '> |</ span >
179+ < span class ='id identifier rubyid_result '> result</ span > < span class ='lbracket '> [</ span > < span class ='id identifier rubyid_key '> key</ span > < span class ='rbracket '> ]</ span > < span class ='op '> =</ span > < span class ='kw '> yield</ span > < span class ='lparen '> (</ span > < span class ='id identifier rubyid_value '> value</ span > < span class ='rparen '> )</ span >
180+ < span class ='kw '> end</ span >
181+ < span class ='id identifier rubyid_result '> result</ span >
182+ < span class ='kw '> end</ span > </ pre >
183+ </ td >
184+ </ tr >
185+ </ table >
186+ </ div >
187+
188+ </ div >
189+
190+ </ div >
191+
192+ < div id ="footer ">
193+ Generated on Wed May 21 21:33:37 2025 by
194+ < a href ="https://yardoc.org " title ="Yay! A Ruby Documentation Tool " target ="_parent "> yard</ a >
195+ 0.9.37 (ruby-3.4.3).
196+ </ div >
197+
198+ </ div >
199+ </ body >
200+ </ html >
0 commit comments