Class: Retab::UsageBlockRecord

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/retab/usage/usage_block_record.rb

Constant Summary collapse

HASH_ATTRS =
{
  block_id: :block_id,
  block_type: :block_type,
  credits: :credits,
  execution_count: :execution_count,
  first_activity_at: :first_activity_at,
  last_activity_at: :last_activity_at,
  page_count: :page_count,
  run_count: :run_count,
  status_counts: :status_counts,
  workflow_id: :workflow_id
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ UsageBlockRecord

Returns a new instance of UsageBlockRecord.



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/retab/usage/usage_block_record.rb', line 34

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @block_id = hash[:block_id]
  @block_type = hash[:block_type]
  @credits = hash[:credits]
  @execution_count = hash[:execution_count]
  @first_activity_at = hash[:first_activity_at]
  @last_activity_at = hash[:last_activity_at]
  @page_count = hash[:page_count]
  @run_count = hash[:run_count]
  @status_counts = hash[:status_counts] || {}
  @workflow_id = hash[:workflow_id]
end

Instance Attribute Details

#block_idObject

Returns the value of attribute block_id.



21
22
23
# File 'lib/retab/usage/usage_block_record.rb', line 21

def block_id
  @block_id
end

#block_typeObject

Returns the value of attribute block_type.



21
22
23
# File 'lib/retab/usage/usage_block_record.rb', line 21

def block_type
  @block_type
end

#creditsObject

Returns the value of attribute credits.



21
22
23
# File 'lib/retab/usage/usage_block_record.rb', line 21

def credits
  @credits
end

#execution_countObject

Returns the value of attribute execution_count.



21
22
23
# File 'lib/retab/usage/usage_block_record.rb', line 21

def execution_count
  @execution_count
end

#first_activity_atObject

Returns the value of attribute first_activity_at.



21
22
23
# File 'lib/retab/usage/usage_block_record.rb', line 21

def first_activity_at
  @first_activity_at
end

#last_activity_atObject

Returns the value of attribute last_activity_at.



21
22
23
# File 'lib/retab/usage/usage_block_record.rb', line 21

def last_activity_at
  @last_activity_at
end

#page_countObject

Returns the value of attribute page_count.



21
22
23
# File 'lib/retab/usage/usage_block_record.rb', line 21

def page_count
  @page_count
end

#run_countObject

Returns the value of attribute run_count.



21
22
23
# File 'lib/retab/usage/usage_block_record.rb', line 21

def run_count
  @run_count
end

#status_countsObject

Returns the value of attribute status_counts.



21
22
23
# File 'lib/retab/usage/usage_block_record.rb', line 21

def status_counts
  @status_counts
end

#workflow_idObject

Returns the value of attribute workflow_id.



21
22
23
# File 'lib/retab/usage/usage_block_record.rb', line 21

def workflow_id
  @workflow_id
end