Class: Pago::V2026_04::Models::MeterQuantity
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ timestamp: "timestamp", quantity: "quantity" }.freeze
- REQUIRED_KEYS =
["timestamp", "quantity"].freeze
Instance Attribute Summary collapse
-
#quantity ⇒ Float
readonly
The quantity for the current period.
-
#timestamp ⇒ String
readonly
The timestamp for the current period.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(timestamp:, quantity:) ⇒ MeterQuantity
constructor
A new instance of MeterQuantity.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(timestamp:, quantity:) ⇒ MeterQuantity
Returns a new instance of MeterQuantity.
29458 29459 29460 29461 29462 29463 29464 29465 |
# File 'lib/pago/v2026_04/models.rb', line 29458 def initialize( timestamp:, quantity: ) super() assign(:timestamp, ) assign(:quantity, quantity) end |
Instance Attribute Details
#quantity ⇒ Float (readonly)
The quantity for the current period.
29456 29457 29458 |
# File 'lib/pago/v2026_04/models.rb', line 29456 def quantity @quantity end |
#timestamp ⇒ String (readonly)
The timestamp for the current period.
29452 29453 29454 |
# File 'lib/pago/v2026_04/models.rb', line 29452 def @timestamp end |
Class Method Details
.from_json(data) ⇒ MeterQuantity?
29469 29470 29471 29472 29473 29474 29475 29476 29477 29478 29479 29480 29481 |
# File 'lib/pago/v2026_04/models.rb', line 29469 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( timestamp: (data.key?("timestamp") ? data["timestamp"] : ::Pago::UNSET), quantity: (data.key?("quantity") ? data["quantity"] : ::Pago::UNSET) ), data ) end |