Class: Rafflesia::UsageSummaryData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::UsageSummaryData
- Defined in:
- lib/rafflesia/billing/usage_summary_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ bucket_interval: :bucket_interval, cost_usd_data: :cost_usd_data, currency: :currency, data: :data, ended_at: :ended_at, environment_id: :environment_id, object: :object, operations_data: :operations_data, organization_id: :organization_id, started_at: :started_at, total_rated_amount_microusd: :total_rated_amount_microusd }.freeze
Instance Attribute Summary collapse
-
#bucket_interval ⇒ Object
Returns the value of attribute bucket_interval.
-
#cost_usd_data ⇒ Object
Returns the value of attribute cost_usd_data.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#data ⇒ Object
Returns the value of attribute data.
-
#ended_at ⇒ Object
Returns the value of attribute ended_at.
-
#environment_id ⇒ Object
Returns the value of attribute environment_id.
-
#object ⇒ Object
Returns the value of attribute object.
-
#operations_data ⇒ Object
Returns the value of attribute operations_data.
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
-
#total_rated_amount_microusd ⇒ Object
Returns the value of attribute total_rated_amount_microusd.
Instance Method Summary collapse
-
#initialize(json) ⇒ UsageSummaryData
constructor
A new instance of UsageSummaryData.
Constructor Details
#initialize(json) ⇒ UsageSummaryData
Returns a new instance of UsageSummaryData.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 35 def initialize(json) super() hash = self.class.normalize(json) @bucket_interval = hash[:bucket_interval] @cost_usd_data = (hash[:cost_usd_data] || []).map { |item| item ? Rafflesia::UsageTimeSeriesPoint.new(item) : nil } @currency = hash[:currency] @data = (hash[:data] || []).map { |item| item ? Rafflesia::UsageSummary.new(item) : nil } @ended_at = hash[:ended_at] @environment_id = hash[:environment_id] @object = hash[:object] @operations_data = (hash[:operations_data] || []).map { |item| item ? Rafflesia::UsageTimeSeriesPoint.new(item) : nil } @organization_id = hash[:organization_id] @started_at = hash[:started_at] @total_rated_amount_microusd = hash[:total_rated_amount_microusd] end |
Instance Attribute Details
#bucket_interval ⇒ Object
Returns the value of attribute bucket_interval.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def bucket_interval @bucket_interval end |
#cost_usd_data ⇒ Object
Returns the value of attribute cost_usd_data.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def cost_usd_data @cost_usd_data end |
#currency ⇒ Object
Returns the value of attribute currency.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def currency @currency end |
#data ⇒ Object
Returns the value of attribute data.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def data @data end |
#ended_at ⇒ Object
Returns the value of attribute ended_at.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def ended_at @ended_at end |
#environment_id ⇒ Object
Returns the value of attribute environment_id.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def environment_id @environment_id end |
#object ⇒ Object
Returns the value of attribute object.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def object @object end |
#operations_data ⇒ Object
Returns the value of attribute operations_data.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def operations_data @operations_data end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def organization_id @organization_id end |
#started_at ⇒ Object
Returns the value of attribute started_at.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def started_at @started_at end |
#total_rated_amount_microusd ⇒ Object
Returns the value of attribute total_rated_amount_microusd.
22 23 24 |
# File 'lib/rafflesia/billing/usage_summary_data.rb', line 22 def total_rated_amount_microusd @total_rated_amount_microusd end |