We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nil
This are my mappers: I've changed the initalize if the input is nil would build and empty skeleton.
class MobileConfigMapper < HashMap::Base transforms_output HashMap::UnderscoreKeys def initialize(hash) input = hash || {} super(input) end properties 'EnableBookingAir', 'EnableChangeAir', 'EnableCancelAir', 'EnableBookingHotel', 'EnableChangeHotel', 'EnableCancelHotel', 'EnableBookingCar', 'EnableChangeCar', 'EnableCancelCar', 'EnableCertify', 'EnableLyft', 'EnableGoogleFlights', 'EnableHilton', 'EnableProfileAccess', 'EnableSecureLocateMe', 'EnableEULA' end class CompanySettingsMapper < HashMap::Base transforms_output HashMap::UnderscoreKeys from_child 'CompanySettings' do from_child 'CompanyIdentity' do property 'CompanyGuid' end properties 'IsCertifyEnabled', 'IsProfileEnabled' property 'PathMobileConfig', mapper: MobileConfigMapper end end
hash:
{ "StatusCode": 200, "ErrorDescription": null, "Messages": null, "CompanySettings": { "CompanyIdentity": { "CompanyGuid": "0A6005FA-161D-4290-BB7D-B21B14313807", "PseudoCity": { "Code": "PARTQ2447" } }, "IsCertifyEnabled": false, "IsProfileEnabled": true, "PathMobileConfig": null } }
I expect PathMobileConfig or it's transformation path_mobile_config to be {} but it always returns `nil``
PathMobileConfig
path_mobile_config
{}
For now I will use the block turnaround:
block
property 'PathMobileConfig' do |settings| if hash = settings['PathMobileConfig'] MobileConfigMapper.call(hash) else {} end end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This are my mappers:
I've changed the initalize if the input is
nil
would build and empty skeleton.hash:
I expect
PathMobileConfig
or it's transformationpath_mobile_config
to be{}
but it always returns `nil``For now I will use the
block
turnaround:The text was updated successfully, but these errors were encountered: