Class: Rafflesia::EnvironmentTask
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::EnvironmentTask
- Defined in:
- lib/rafflesia/environment_tasks/environment_task.rb
Constant Summary collapse
- HASH_ATTRS =
{ capability_ids: :capability_ids, created_at: :created_at, difficulty: :difficulty, environment_id: :environment_id, environment_release_id: :environment_release_id, grader_hash: :grader_hash, id: :id, is_livemode: :is_livemode, kind: :kind, metadata: :metadata, object: :object, output_contract: :output_contract, prompt: :prompt, reward_contract: :reward_contract, reward_definition_id: :reward_definition_id, runtime_profile_id: :runtime_profile_id, source_task_id: :source_task_id, task_hash: :task_hash, title: :title, warnings: :warnings }.freeze
Instance Attribute Summary collapse
-
#capability_ids ⇒ Object
Returns the value of attribute capability_ids.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#difficulty ⇒ Object
Returns the value of attribute difficulty.
-
#environment_id ⇒ Object
Returns the value of attribute environment_id.
-
#environment_release_id ⇒ Object
Returns the value of attribute environment_release_id.
-
#grader_hash ⇒ Object
Returns the value of attribute grader_hash.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_livemode ⇒ Object
Returns the value of attribute is_livemode.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#object ⇒ Object
Returns the value of attribute object.
-
#output_contract ⇒ Object
Returns the value of attribute output_contract.
-
#prompt ⇒ Object
Returns the value of attribute prompt.
-
#reward_contract ⇒ Object
Returns the value of attribute reward_contract.
-
#reward_definition_id ⇒ Object
Returns the value of attribute reward_definition_id.
-
#runtime_profile_id ⇒ Object
Returns the value of attribute runtime_profile_id.
-
#source_task_id ⇒ Object
Returns the value of attribute source_task_id.
-
#task_hash ⇒ Object
Returns the value of attribute task_hash.
-
#title ⇒ Object
Returns the value of attribute title.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(json) ⇒ EnvironmentTask
constructor
A new instance of EnvironmentTask.
Constructor Details
#initialize(json) ⇒ EnvironmentTask
Returns a new instance of EnvironmentTask.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 53 def initialize(json) super() hash = self.class.normalize(json) @capability_ids = (hash[:capability_ids] || []) @created_at = hash[:created_at] @difficulty = hash[:difficulty] @environment_id = hash[:environment_id] @environment_release_id = hash[:environment_release_id] @grader_hash = hash[:grader_hash] @id = hash[:id] @is_livemode = hash[:is_livemode] @kind = hash[:kind] @metadata = hash[:metadata] || {} @object = hash[:object] @output_contract = hash[:output_contract] || {} @prompt = hash[:prompt] @reward_contract = hash[:reward_contract] || {} @reward_definition_id = hash[:reward_definition_id] @runtime_profile_id = hash[:runtime_profile_id] @source_task_id = hash[:source_task_id] @task_hash = hash[:task_hash] @title = hash[:title] @warnings = (hash[:warnings] || []) end |
Instance Attribute Details
#capability_ids ⇒ Object
Returns the value of attribute capability_ids.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def capability_ids @capability_ids end |
#created_at ⇒ Object
Returns the value of attribute created_at.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def created_at @created_at end |
#difficulty ⇒ Object
Returns the value of attribute difficulty.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def difficulty @difficulty end |
#environment_id ⇒ Object
Returns the value of attribute environment_id.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def environment_id @environment_id end |
#environment_release_id ⇒ Object
Returns the value of attribute environment_release_id.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def environment_release_id @environment_release_id end |
#grader_hash ⇒ Object
Returns the value of attribute grader_hash.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def grader_hash @grader_hash end |
#id ⇒ Object
Returns the value of attribute id.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def id @id end |
#is_livemode ⇒ Object
Returns the value of attribute is_livemode.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def is_livemode @is_livemode end |
#kind ⇒ Object
Returns the value of attribute kind.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def kind @kind end |
#metadata ⇒ Object
Returns the value of attribute metadata.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def @metadata end |
#object ⇒ Object
Returns the value of attribute object.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def object @object end |
#output_contract ⇒ Object
Returns the value of attribute output_contract.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def output_contract @output_contract end |
#prompt ⇒ Object
Returns the value of attribute prompt.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def prompt @prompt end |
#reward_contract ⇒ Object
Returns the value of attribute reward_contract.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def reward_contract @reward_contract end |
#reward_definition_id ⇒ Object
Returns the value of attribute reward_definition_id.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def reward_definition_id @reward_definition_id end |
#runtime_profile_id ⇒ Object
Returns the value of attribute runtime_profile_id.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def runtime_profile_id @runtime_profile_id end |
#source_task_id ⇒ Object
Returns the value of attribute source_task_id.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def source_task_id @source_task_id end |
#task_hash ⇒ Object
Returns the value of attribute task_hash.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def task_hash @task_hash end |
#title ⇒ Object
Returns the value of attribute title.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def title @title end |
#warnings ⇒ Object
Returns the value of attribute warnings.
31 32 33 |
# File 'lib/rafflesia/environment_tasks/environment_task.rb', line 31 def warnings @warnings end |