Class: Rafflesia::DiamondSearchData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/sequences/diamond_search_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  backend: :backend,
  command: :command,
  db: :db,
  db_prefix: :db_prefix,
  dry_run: :dry_run,
  hit_count: :hit_count,
  hits: :hits,
  manifest_id: :manifest_id,
  materialization: :materialization,
  output_object: :output_object,
  output_path: :output_path,
  parameters: :parameters,
  program: :program,
  query: :query,
  raw_output_object: :raw_output_object,
  relation: :relation
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ DiamondSearchData

Returns a new instance of DiamondSearchData.



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 45

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @backend = hash[:backend]
  @command = (hash[:command] || [])
  @db = hash[:db]
  @db_prefix = hash[:db_prefix]
  @dry_run = hash[:dry_run]
  @hit_count = hash[:hit_count]
  @hits = (hash[:hits] || []).map { |item| item ? Rafflesia::DiamondSearchHit.new(item) : nil }
  @manifest_id = hash[:manifest_id]
  @materialization = hash[:materialization] ? Rafflesia::DiamondDbMaterializeData.new(hash[:materialization]) : nil
  @output_object = hash[:output_object] ? Rafflesia::ObjectRef.new(hash[:output_object]) : nil
  @output_path = hash[:output_path]
  @parameters = hash[:parameters] || {}
  @program = hash[:program]
  @query = hash[:query]
  @raw_output_object = hash[:raw_output_object] ? Rafflesia::ObjectRef.new(hash[:raw_output_object]) : nil
  @relation = hash[:relation] ? Rafflesia::RelationArtifactData.new(hash[:relation]) : nil
end

Instance Attribute Details

#backendObject

Returns the value of attribute backend.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def backend
  @backend
end

#commandObject

Returns the value of attribute command.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def command
  @command
end

#dbObject

Returns the value of attribute db.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def db
  @db
end

#db_prefixObject

Returns the value of attribute db_prefix.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def db_prefix
  @db_prefix
end

#dry_runObject

Returns the value of attribute dry_run.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def dry_run
  @dry_run
end

#hit_countObject

Returns the value of attribute hit_count.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def hit_count
  @hit_count
end

#hitsObject

Returns the value of attribute hits.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def hits
  @hits
end

#manifest_idObject

Returns the value of attribute manifest_id.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def manifest_id
  @manifest_id
end

#materializationObject

Returns the value of attribute materialization.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def materialization
  @materialization
end

#output_objectObject

Returns the value of attribute output_object.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def output_object
  @output_object
end

#output_pathObject

Returns the value of attribute output_path.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def output_path
  @output_path
end

#parametersObject

Returns the value of attribute parameters.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def parameters
  @parameters
end

#programObject

Returns the value of attribute program.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def program
  @program
end

#queryObject

Returns the value of attribute query.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def query
  @query
end

#raw_output_objectObject

Returns the value of attribute raw_output_object.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def raw_output_object
  @raw_output_object
end

#relationObject

Returns the value of attribute relation.



27
28
29
# File 'lib/rafflesia/sequences/diamond_search_data.rb', line 27

def relation
  @relation
end