Module: Airbnb::Service::Hongbao::Api::HongbaoActiveCampaignRequestSmartclientModule::GenerateInstanceMethods
- Defined in:
- lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb
Constant Summary collapse
- JSON_NAME_OVERRIDES =
{ }.freeze
Instance Method Summary collapse
-
#to_hash(options = nil) ⇒ Object
(also: #to_h)
options: case_from_idl: use the exact case from IDL file to when generating the hash key.
- #to_json(options = nil) ⇒ Object
Instance Method Details
#to_hash(options = nil) ⇒ Object Also known as: to_h
options:
case_from_idl: use the exact case from IDL file to when generating the hash key. Default is false.
ignore_nil_field: do not generate key in the hash, if the value is nil. Useful for inspect or data transport. Default is false.
1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 |
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 1406 def to_hash( = nil) res = {} ||= {} case_from_idl = .nil? ? false : [:case_from_idl] ignore_nil_field = .nil? ? false : [:ignore_nil_field] if case_from_idl else # enforcing to use snake case end res end |
#to_json(options = nil) ⇒ Object
1399 1400 1401 |
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 1399 def to_json( = nil) JSON.generate(to_hash()) end |