README.md in flexirest-1.3.24 vs README.md in flexirest-1.3.25

- old
+ new

@@ -700,11 +700,11 @@ ?param=1&param=2&param=3 ``` ### Automatic Conversion of Fields to Date/DateTime -By default Flexirest will attempt to convert all fields to a Date or DateTime object if it's a string and the value matches a pair of regular expressions. However, on large responses this can be computationally expensive. So, you can either disable this automatic conversion completely with: +By default Flexirest will attempt to convert all fields to a Date or DateTime object if it's a string and the value matches a pair of regular expressions. However, on large responses this can be computationally expensive. You can disable this automatic conversion completely with: ```ruby Flexirest::Base.disable_automatic_date_parsing = true ``` @@ -713,9 +713,24 @@ ```ruby class Person < Flexirest::Base get :all, '/people', parse_fields: [:created_at, :updated_at] end ``` + +It is also possible to whitelist fields should be parsed in your models, which is useful if you are instantiating these objects directly. The specified fields also apply automatically to request mapping. + +```ruby +class Person < Flexirest::Base + parse_date :updated_at, :created_at +end + +# to disable all mapping +class Disabled < Flexirest::Base + parse_date :none +end +``` + +This system respects `disable_automatic_date_parsing`, and will default to mapping everything - unless a `parse_date` whitelist is specified, or automatic parsing is globally disabled. ### Raw Requests Sometimes you have have a URL that you just want to force through, but have the response handled in the same way as normal objects or you want to have the callbacks run (say for authentication). The easiest way to do that is to call `_request` on the class: