Class: Pago::V2026_04::Models::CostMetadataInput
- 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 ⇒ Float, String
readonly
The amount in cents.
-
#currency ⇒ String
readonly
The currency.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(amount:, currency:) ⇒ CostMetadataInput
constructor
A new instance of CostMetadataInput.
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:) ⇒ CostMetadataInput
Returns a new instance of CostMetadataInput.
13014 13015 13016 13017 13018 13019 13020 13021 |
# File 'lib/pago/v2026_04/models.rb', line 13014 def initialize( amount:, currency: ) super() assign(:amount, amount) assign(:currency, currency) end |
Instance Attribute Details
#amount ⇒ Float, String (readonly)
The amount in cents.
13008 13009 13010 |
# File 'lib/pago/v2026_04/models.rb', line 13008 def amount @amount end |
#currency ⇒ String (readonly)
The currency. Currently, only usd is supported.
13012 13013 13014 |
# File 'lib/pago/v2026_04/models.rb', line 13012 def currency @currency end |
Class Method Details
.from_json(data) ⇒ CostMetadataInput?
13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 |
# File 'lib/pago/v2026_04/models.rb', line 13025 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 |