Module: Airbnb::Service::Hongbao::Api::HongbaoCampaignTextDataRequestSmartclientModule::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.
2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 |
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 2808 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
2801 2802 2803 |
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 2801 def to_json( = nil) JSON.generate(to_hash()) end |