Class: Rafflesia::UsageSummary
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::UsageSummary
- 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
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#event_count ⇒ Object
Returns the value of attribute event_count.
-
#meter ⇒ Object
Returns the value of attribute meter.
-
#product ⇒ Object
Returns the value of attribute product.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#rated_amount_microusd ⇒ Object
Returns the value of attribute rated_amount_microusd.
-
#unit ⇒ Object
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(json) ⇒ UsageSummary
constructor
A new instance of UsageSummary.
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
#currency ⇒ Object
Returns the value of attribute currency.
18 19 20 |
# File 'lib/rafflesia/billing/usage_summary.rb', line 18 def currency @currency end |
#event_count ⇒ Object
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 |
#meter ⇒ Object
Returns the value of attribute meter.
18 19 20 |
# File 'lib/rafflesia/billing/usage_summary.rb', line 18 def meter @meter end |
#product ⇒ Object
Returns the value of attribute product.
18 19 20 |
# File 'lib/rafflesia/billing/usage_summary.rb', line 18 def product @product end |
#quantity ⇒ Object
Returns the value of attribute quantity.
18 19 20 |
# File 'lib/rafflesia/billing/usage_summary.rb', line 18 def quantity @quantity end |
#rated_amount_microusd ⇒ Object
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 |
#unit ⇒ Object
Returns the value of attribute unit.
18 19 20 |
# File 'lib/rafflesia/billing/usage_summary.rb', line 18 def unit @unit end |