Module: MangoPay::Jsonifier
- Included in:
- CancelRequest, CompleteRegistrationRequest, CurrencyRequest, DeactivationRequest, MangoModel::Address, MangoModel::ApplePayPayIn, MangoModel::BankWireDirectPayIn, MangoModel::BankWireExternalInstructionPayIn, MangoModel::BankingAlias, MangoModel::Billing, MangoModel::Birthplace, MangoModel::BrowserInfo, MangoModel::CaBankAccount, MangoModel::Card, MangoModel::CardDirectPayIn, MangoModel::CardPreAuthorizedPayIn, MangoModel::CardRegistration, MangoModel::CardWebPayIn, MangoModel::Client, MangoModel::ClientWallet, MangoModel::DebitedBankAccount, MangoModel::DeclaredUbo, MangoModel::DirectDebitDirectPayIn, MangoModel::DirectDebitWebPayIn, MangoModel::Dispute, MangoModel::DisputeDocument, MangoModel::DisputeReason, MangoModel::DocumentPageConsult, MangoModel::EMoney, MangoModel::Event, MangoModel::GbBankAccount, MangoModel::GooglePayPayIn, MangoModel::Hook, MangoModel::IbanBankAccount, MangoModel::KycDocument, MangoModel::LegalUser, MangoModel::Mandate, MangoModel::Money, MangoModel::NaturalUser, MangoModel::OtherBankAccount, MangoModel::PayInWebExtendedView, MangoModel::PayOut, MangoModel::PaypalWebPayIn, MangoModel::PlatformCategorization, MangoModel::PreAuthorization, MangoModel::Refund, MangoModel::RefundReason, MangoModel::Report, MangoModel::Repudiation, MangoModel::ResponseReplica, MangoModel::ScopeBlocked, MangoModel::SecurityInfo, MangoModel::SettlementTransfer, MangoModel::Shipping, MangoModel::Transaction, MangoModel::Transfer, MangoModel::Ubo, MangoModel::UboDeclaration, MangoModel::UsBankAccount, MangoModel::UserBlockStatus, MangoModel::Wallet, ReportFilter, SubmitDocumentRequest, SubmitUboDeclarationRequest, TemplateUrlOptions, UploadFileRequest
- Defined in:
- lib/mangopay/common/jsonifier.rb
Overview
To be included in order to apply JSON de/serialization methods
Constant Summary collapse
- LOG =
LogProvider.provide(self)
Instance Method Summary collapse
-
#dejsonify(hash) ⇒ Object
De-serializes an object from a JSON-originating hash.
-
#jsonify! ⇒ String
Serializes an object to a JSON string.
Instance Method Details
#dejsonify(hash) ⇒ Object
De-serializes an object from a JSON-originating hash.
#jsonify! ⇒ String
Serializes an object to a JSON string. Read-only fields will be removed
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/mangopay/common/jsonifier.rb', line 44 def jsonify! json = hashed_variables.to_json # hash.to_json() sometimes adds # unnecessary backslashes and double quotes json.delete!('\\') json.gsub!(/"{/, '{') json.gsub!(/}"/, '}') LOG.debug 'JSONIFIED {}', inspect LOG.debug 'INTO {}', json json end |