Module: Airbnb::Service::Hongbao::Api::HongbaoCampaignTextDataResponseSmartclientModule::GenerateInstanceMethods

Defined in:
lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb

Constant Summary collapse

JSON_NAME_OVERRIDES =
{
}.freeze

Instance Method Summary collapse

Instance Method Details

#claim_butonObject



2873
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 2873

def claim_buton; @claimButon; end

#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.


2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 2882

def to_hash(options = nil)
  res = {}
  options ||= {}
  case_from_idl = options.nil? ? false : options[:case_from_idl]
  ignore_nil_field = options.nil? ? false : options[:ignore_nil_field]
  if case_from_idl
    if !(ignore_nil_field && claim_buton.nil?)
      _json_key_name = JSON_NAME_OVERRIDES.key?(:claimButon) ? JSON_NAME_OVERRIDES[:claimButon] : :claimButon
      res[_json_key_name] = claim_buton
    end
  else # enforcing to use snake case
    if !(ignore_nil_field && claim_buton.nil?)
      _json_key_name = JSON_NAME_OVERRIDES.key?(:claimButon) ?  JSON_NAME_OVERRIDES[:claimButon] : :claim_buton
      res[_json_key_name] = claim_buton
    end
  end
  res
end

#to_json(options = nil) ⇒ Object



2875
2876
2877
# File 'lib/airbnb/service/hongbao/api/hongbao_data_smartclient_modules.rb', line 2875

def to_json(options = nil)
  JSON.generate(to_hash(options))
end