Class: Rafflesia::Provenance
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::Provenance
- Defined in:
- lib/rafflesia/annotations/provenance.rb
Constant Summary collapse
- HASH_ATTRS =
{ cache_hit: :cache_hit, created_at: :created_at, database_snapshots: :database_snapshots, generated_object_ids: :generated_object_ids, input_hash: :input_hash, operation: :operation, parameters_hash: :parameters_hash, request_id: :request_id, server_version: :server_version, tool_versions: :tool_versions }.freeze
Instance Attribute Summary collapse
-
#cache_hit ⇒ Object
Returns the value of attribute cache_hit.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#database_snapshots ⇒ Object
Returns the value of attribute database_snapshots.
-
#generated_object_ids ⇒ Object
Returns the value of attribute generated_object_ids.
-
#input_hash ⇒ Object
Returns the value of attribute input_hash.
-
#operation ⇒ Object
Returns the value of attribute operation.
-
#parameters_hash ⇒ Object
Returns the value of attribute parameters_hash.
-
#request_id ⇒ Object
Returns the value of attribute request_id.
-
#server_version ⇒ Object
Returns the value of attribute server_version.
-
#tool_versions ⇒ Object
Returns the value of attribute tool_versions.
Instance Method Summary collapse
-
#initialize(json) ⇒ Provenance
constructor
A new instance of Provenance.
Constructor Details
#initialize(json) ⇒ Provenance
Returns a new instance of Provenance.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rafflesia/annotations/provenance.rb', line 33 def initialize(json) super() hash = self.class.normalize(json) @cache_hit = hash[:cache_hit] @created_at = hash[:created_at] @database_snapshots = (hash[:database_snapshots] || []).map { |item| item ? Rafflesia::DatabaseSnapshot.new(item) : nil } @generated_object_ids = (hash[:generated_object_ids] || []) @input_hash = hash[:input_hash] @operation = hash[:operation] @parameters_hash = hash[:parameters_hash] @request_id = hash[:request_id] @server_version = hash[:server_version] @tool_versions = (hash[:tool_versions] || []).map { |item| item ? Rafflesia::ToolVersion.new(item) : nil } end |
Instance Attribute Details
#cache_hit ⇒ Object
Returns the value of attribute cache_hit.
21 22 23 |
# File 'lib/rafflesia/annotations/provenance.rb', line 21 def cache_hit @cache_hit end |
#created_at ⇒ Object
Returns the value of attribute created_at.
21 22 23 |
# File 'lib/rafflesia/annotations/provenance.rb', line 21 def created_at @created_at end |
#database_snapshots ⇒ Object
Returns the value of attribute database_snapshots.
21 22 23 |
# File 'lib/rafflesia/annotations/provenance.rb', line 21 def database_snapshots @database_snapshots end |
#generated_object_ids ⇒ Object
Returns the value of attribute generated_object_ids.
21 22 23 |
# File 'lib/rafflesia/annotations/provenance.rb', line 21 def generated_object_ids @generated_object_ids end |
#input_hash ⇒ Object
Returns the value of attribute input_hash.
21 22 23 |
# File 'lib/rafflesia/annotations/provenance.rb', line 21 def input_hash @input_hash end |
#operation ⇒ Object
Returns the value of attribute operation.
21 22 23 |
# File 'lib/rafflesia/annotations/provenance.rb', line 21 def operation @operation end |
#parameters_hash ⇒ Object
Returns the value of attribute parameters_hash.
21 22 23 |
# File 'lib/rafflesia/annotations/provenance.rb', line 21 def parameters_hash @parameters_hash end |
#request_id ⇒ Object
Returns the value of attribute request_id.
21 22 23 |
# File 'lib/rafflesia/annotations/provenance.rb', line 21 def request_id @request_id end |
#server_version ⇒ Object
Returns the value of attribute server_version.
21 22 23 |
# File 'lib/rafflesia/annotations/provenance.rb', line 21 def server_version @server_version end |
#tool_versions ⇒ Object
Returns the value of attribute tool_versions.
21 22 23 |
# File 'lib/rafflesia/annotations/provenance.rb', line 21 def tool_versions @tool_versions end |