Class: Rafflesia::Episode

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/episodes/episode.rb

Constant Summary collapse

HASH_ATTRS =
{
  active_seconds: :active_seconds,
  artifact_ids: :artifact_ids,
  attempt_count: :attempt_count,
  completed_at: :completed_at,
  created_at: :created_at,
  current_attempt_id: :current_attempt_id,
  environment_id: :environment_id,
  environment_release_id: :environment_release_id,
  environment_task_id: :environment_task_id,
  execution: :execution,
  grade: :grade,
  id: :id,
  is_cancel_requested: :is_cancel_requested,
  is_livemode: :is_livemode,
  last_error: :last_error,
  metadata: :metadata,
  object: :object,
  organization_id: :organization_id,
  origin: :origin,
  provider: :provider,
  rollout_group_id: :rollout_group_id,
  runtime_profile_id: :runtime_profile_id,
  seed: :seed,
  status: :status,
  timeout_seconds: :timeout_seconds,
  updated_at: :updated_at
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Episode

Returns a new instance of Episode.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/rafflesia/episodes/episode.rb', line 65

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @active_seconds = hash[:active_seconds]
  @artifact_ids = (hash[:artifact_ids] || [])
  @attempt_count = hash[:attempt_count]
  @completed_at = hash[:completed_at]
  @created_at = hash[:created_at]
  @current_attempt_id = hash[:current_attempt_id]
  @environment_id = hash[:environment_id]
  @environment_release_id = hash[:environment_release_id]
  @environment_task_id = hash[:environment_task_id]
  @execution = hash[:execution] ? Rafflesia::ExecutionSpec.new(hash[:execution]) : nil
  @grade = hash[:grade] ? Rafflesia::Grade.new(hash[:grade]) : nil
  @id = hash[:id]
  @is_cancel_requested = hash[:is_cancel_requested]
  @is_livemode = hash[:is_livemode]
  @last_error = hash[:last_error]
  @metadata = hash[:metadata] || {}
  @object = hash[:object]
  @organization_id = hash[:organization_id]
  @origin = hash[:origin] ? Rafflesia::EpisodeOrigin.new(hash[:origin]) : nil
  @provider = hash[:provider]
  @rollout_group_id = hash[:rollout_group_id]
  @runtime_profile_id = hash[:runtime_profile_id]
  @seed = hash[:seed]
  @status = hash[:status]
  @timeout_seconds = hash[:timeout_seconds]
  @updated_at = hash[:updated_at]
end

Instance Attribute Details

#active_secondsObject

Returns the value of attribute active_seconds.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def active_seconds
  @active_seconds
end

#artifact_idsObject

Returns the value of attribute artifact_ids.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def artifact_ids
  @artifact_ids
end

#attempt_countObject

Returns the value of attribute attempt_count.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def attempt_count
  @attempt_count
end

#completed_atObject

Returns the value of attribute completed_at.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def completed_at
  @completed_at
end

#created_atObject

Returns the value of attribute created_at.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def created_at
  @created_at
end

#current_attempt_idObject

Returns the value of attribute current_attempt_id.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def current_attempt_id
  @current_attempt_id
end

#environment_idObject

Returns the value of attribute environment_id.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def environment_id
  @environment_id
end

#environment_release_idObject

Returns the value of attribute environment_release_id.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def environment_release_id
  @environment_release_id
end

#environment_task_idObject

Returns the value of attribute environment_task_id.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def environment_task_id
  @environment_task_id
end

#executionObject

Returns the value of attribute execution.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def execution
  @execution
end

#gradeObject

Returns the value of attribute grade.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def grade
  @grade
end

#idObject

Returns the value of attribute id.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def id
  @id
end

#is_cancel_requestedObject

Returns the value of attribute is_cancel_requested.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def is_cancel_requested
  @is_cancel_requested
end

#is_livemodeObject

Returns the value of attribute is_livemode.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def is_livemode
  @is_livemode
end

#last_errorObject

Returns the value of attribute last_error.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def last_error
  @last_error
end

#metadataObject

Returns the value of attribute metadata.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def 
  @metadata
end

#objectObject

Returns the value of attribute object.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def object
  @object
end

#organization_idObject

Returns the value of attribute organization_id.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def organization_id
  @organization_id
end

#originObject

Returns the value of attribute origin.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def origin
  @origin
end

#providerObject

Returns the value of attribute provider.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def provider
  @provider
end

#rollout_group_idObject

Returns the value of attribute rollout_group_id.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def rollout_group_id
  @rollout_group_id
end

#runtime_profile_idObject

Returns the value of attribute runtime_profile_id.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def runtime_profile_id
  @runtime_profile_id
end

#seedObject

Returns the value of attribute seed.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def seed
  @seed
end

#statusObject

Returns the value of attribute status.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def status
  @status
end

#timeout_secondsObject

Returns the value of attribute timeout_seconds.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def timeout_seconds
  @timeout_seconds
end

#updated_atObject

Returns the value of attribute updated_at.



37
38
39
# File 'lib/rafflesia/episodes/episode.rb', line 37

def updated_at
  @updated_at
end