Class: Rafflesia::Provenance

Inherits:
Types::BaseModel
  • Object
show all
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

Instance Method Summary collapse

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_hitObject

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_atObject

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_snapshotsObject

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_idsObject

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_hashObject

Returns the value of attribute input_hash.



21
22
23
# File 'lib/rafflesia/annotations/provenance.rb', line 21

def input_hash
  @input_hash
end

#operationObject

Returns the value of attribute operation.



21
22
23
# File 'lib/rafflesia/annotations/provenance.rb', line 21

def operation
  @operation
end

#parameters_hashObject

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_idObject

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_versionObject

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_versionsObject

Returns the value of attribute tool_versions.



21
22
23
# File 'lib/rafflesia/annotations/provenance.rb', line 21

def tool_versions
  @tool_versions
end