Class: Pago::V2026_04::Models::CostMetadataOutput
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ amount: "amount", currency: "currency" }.freeze
- REQUIRED_KEYS =
["amount", "currency"].freeze
Instance Attribute Summary collapse
-
#amount ⇒ String
readonly
The amount in cents.
-
#currency ⇒ String
readonly
The currency.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(amount:, currency:) ⇒ CostMetadataOutput
constructor
A new instance of CostMetadataOutput.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(amount:, currency:) ⇒ CostMetadataOutput
Returns a new instance of CostMetadataOutput.
13055 13056 13057 13058 13059 13060 13061 13062 |
# File 'lib/pago/v2026_04/models.rb', line 13055 def initialize( amount:, currency: ) super() assign(:amount, amount) assign(:currency, currency) end |
Instance Attribute Details
#amount ⇒ String (readonly)
The amount in cents.
13049 13050 13051 |
# File 'lib/pago/v2026_04/models.rb', line 13049 def amount @amount end |
#currency ⇒ String (readonly)
The currency. Currently, only usd is supported.
13053 13054 13055 |
# File 'lib/pago/v2026_04/models.rb', line 13053 def currency @currency end |
Class Method Details
.from_json(data) ⇒ CostMetadataOutput?
13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 |
# File 'lib/pago/v2026_04/models.rb', line 13066 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( amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET), currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET) ), data ) end |