Class: ZeroClick::Sellers::SyncUsageItem
- Inherits:
-
Object
- Object
- ZeroClick::Sellers::SyncUsageItem
- Defined in:
- lib/zeroclick/sellers/contracts.rb
Overview
Actual usage reported alongside a successful response.
Instance Attribute Summary collapse
-
#meter_slug ⇒ Object
readonly
Returns the value of attribute meter_slug.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#service_slug ⇒ Object
readonly
Returns the value of attribute service_slug.
Instance Method Summary collapse
-
#initialize(service_slug:, meter_slug:, quantity:) ⇒ SyncUsageItem
constructor
A new instance of SyncUsageItem.
- #to_wire ⇒ Object
Constructor Details
#initialize(service_slug:, meter_slug:, quantity:) ⇒ SyncUsageItem
Returns a new instance of SyncUsageItem.
197 198 199 200 201 202 203 204 205 206 |
# File 'lib/zeroclick/sellers/contracts.rb', line 197 def initialize(service_slug:, meter_slug:, quantity:) Sellers.require_slug!(service_slug, "service_slug", "SyncUsageItem") Sellers.require_slug!(meter_slug, "meter_slug", "SyncUsageItem") Sellers.require_positive_integer!(quantity, "quantity", "SyncUsageItem") @service_slug = service_slug @meter_slug = meter_slug @quantity = quantity freeze end |
Instance Attribute Details
#meter_slug ⇒ Object (readonly)
Returns the value of attribute meter_slug.
195 196 197 |
# File 'lib/zeroclick/sellers/contracts.rb', line 195 def meter_slug @meter_slug end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
195 196 197 |
# File 'lib/zeroclick/sellers/contracts.rb', line 195 def quantity @quantity end |
#service_slug ⇒ Object (readonly)
Returns the value of attribute service_slug.
195 196 197 |
# File 'lib/zeroclick/sellers/contracts.rb', line 195 def service_slug @service_slug end |
Instance Method Details
#to_wire ⇒ Object
208 209 210 |
# File 'lib/zeroclick/sellers/contracts.rb', line 208 def to_wire { "serviceSlug" => @service_slug, "meterSlug" => @meter_slug, "quantity" => @quantity } end |