Class: Pago::V2026_04::Models::BenefitCustomProperties

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

Properties for a benefit of type custom.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  note: "note"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["note"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw

Constructor Details

#initialize(note:) ⇒ BenefitCustomProperties

Returns a new instance of BenefitCustomProperties.

Parameters:

  • note: (String, nil, nil)


2226
2227
2228
2229
2230
2231
# File 'lib/pago/v2026_04/models.rb', line 2226

def initialize(
  note:
)
  super()
  assign(:note, note)
end

Instance Attribute Details

#noteString? (readonly)

Returns:

  • (String, nil, nil)


2224
2225
2226
# File 'lib/pago/v2026_04/models.rb', line 2224

def note
  @note
end

Class Method Details

.from_json(data) ⇒ BenefitCustomProperties?

Parameters:

  • data (Hash, String, nil)

Returns:



2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
# File 'lib/pago/v2026_04/models.rb', line 2235

def self.from_json(data)
  data = ::JSON.parse(data) if data.is_a?(String)
  data = ::Pago::Serde.object(data)
  return nil if data.nil?

  wrap_raw(
    new(
      note: (data.key?("note") ? data["note"] : ::Pago::UNSET)
    ),
    data
  )
end