Class: Rafflesia::UsageSummary

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/billing/usage_summary.rb

Constant Summary collapse

HASH_ATTRS =
{
  currency: :currency,
  event_count: :event_count,
  meter: :meter,
  product: :product,
  quantity: :quantity,
  rated_amount_microusd: :rated_amount_microusd,
  unit: :unit
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ UsageSummary

Returns a new instance of UsageSummary.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rafflesia/billing/usage_summary.rb', line 27

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @currency = hash[:currency]
  @event_count = hash[:event_count]
  @meter = hash[:meter]
  @product = hash[:product]
  @quantity = hash[:quantity]
  @rated_amount_microusd = hash[:rated_amount_microusd]
  @unit = hash[:unit]
end

Instance Attribute Details

#currencyObject

Returns the value of attribute currency.



18
19
20
# File 'lib/rafflesia/billing/usage_summary.rb', line 18

def currency
  @currency
end

#event_countObject

Returns the value of attribute event_count.



18
19
20
# File 'lib/rafflesia/billing/usage_summary.rb', line 18

def event_count
  @event_count
end

#meterObject

Returns the value of attribute meter.



18
19
20
# File 'lib/rafflesia/billing/usage_summary.rb', line 18

def meter
  @meter
end

#productObject

Returns the value of attribute product.



18
19
20
# File 'lib/rafflesia/billing/usage_summary.rb', line 18

def product
  @product
end

#quantityObject

Returns the value of attribute quantity.



18
19
20
# File 'lib/rafflesia/billing/usage_summary.rb', line 18

def quantity
  @quantity
end

#rated_amount_microusdObject

Returns the value of attribute rated_amount_microusd.



18
19
20
# File 'lib/rafflesia/billing/usage_summary.rb', line 18

def rated_amount_microusd
  @rated_amount_microusd
end

#unitObject

Returns the value of attribute unit.



18
19
20
# File 'lib/rafflesia/billing/usage_summary.rb', line 18

def unit
  @unit
end