@@ -509,29 +509,35 @@ As of v2.0.11, if you need to serialize the parsed result, you can!
509509
510510There are two ways to do this, globally, or discretely. The discrete way is recommended.
511511
512- 1 . Globally configure ` SnakyHash::StringKeyed ` to use the serializer. Put this in your code somewhere reasonable (like an initializer for Rails):
512+ ##### Global Serialization Config
513513
514- ``` ruby
514+ Globally configure ` SnakyHash::StringKeyed ` to use the serializer. Put this in your code somewhere reasonable (like an initializer for Rails).
515+
516+ ``` ruby
515517SnakyHash ::StringKeyed .class_eval do
516518 extend SnakyHash ::Serializer
517519end
518- ```
520+ ```
521+
522+ ##### Discrete Serialization Config
519523
520- 2 . Discretely configure a custom Snaky Hash class to use the serializer:
524+ Discretely configure a custom Snaky Hash class to use the serializer.
521525
522- ` ` ` ruby
526+ ``` ruby
523527class MySnakyHash < SnakyHash ::StringKeyed
524528 # Give this hash class `dump` and `load` abilities!
525529 extend SnakyHash ::Serializer
526530end
527531
528- # And tell your client to use the custom class in each call:
532+ # And tell your client to use the custom class in each call:
529533client = OAuth2 ::Client .new (" client_id" , " client_secret" , site: " https://example.org/oauth2" )
530534token = client.get_token({snaky_hash_klass: MySnakyHash })
531- ` ` `
535+ ```
532536
533537##### Serialization Extensions
534538
539+ These extensions work regardless of whether you used the global or discrete config above.
540+
535541There are a few hacks you may need in your class to support Ruby < 2.4.2 or < 2.6.
536542They are likely not needed if you are on a newer Ruby.
537543See ` response_spec.rb ` if you need to study the hacks for older Rubies.
@@ -791,7 +797,7 @@ For example:
791797spec.add_dependency(" oauth2" , " ~> 2.0" )
792798```
793799
794- See [CHANGELOG.md][📌changelog] for list of releases.
800+ See [ CHANGELOG.md] [ 📌changelog ] for a list of releases.
795801
796802## 📄 License
797803
0 commit comments