Class: Rafflesia::SequenceSearchData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::SequenceSearchData
- Defined in:
- lib/rafflesia/sequences/sequence_search_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ backend: :backend, db: :db, hits: :hits, index_id: :index_id, query: :query, relation: :relation, seed_index: :seed_index, total_matched: :total_matched }.freeze
Instance Attribute Summary collapse
-
#backend ⇒ Object
Returns the value of attribute backend.
-
#db ⇒ Object
Returns the value of attribute db.
-
#hits ⇒ Object
Returns the value of attribute hits.
-
#index_id ⇒ Object
Returns the value of attribute index_id.
-
#query ⇒ Object
Returns the value of attribute query.
-
#relation ⇒ Object
Returns the value of attribute relation.
-
#seed_index ⇒ Object
Returns the value of attribute seed_index.
-
#total_matched ⇒ Object
Returns the value of attribute total_matched.
Instance Method Summary collapse
-
#initialize(json) ⇒ SequenceSearchData
constructor
A new instance of SequenceSearchData.
Constructor Details
#initialize(json) ⇒ SequenceSearchData
Returns a new instance of SequenceSearchData.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rafflesia/sequences/sequence_search_data.rb', line 29 def initialize(json) super() hash = self.class.normalize(json) @backend = hash[:backend] @db = hash[:db] @hits = (hash[:hits] || []).map { |item| item ? Rafflesia::SequenceSearchHit.new(item) : nil } @index_id = hash[:index_id] @query = hash[:query] @relation = hash[:relation] ? Rafflesia::RelationArtifactData.new(hash[:relation]) : nil @seed_index = hash[:seed_index] ? Rafflesia::SequenceSeedIndexSearchMetrics.new(hash[:seed_index]) : nil @total_matched = hash[:total_matched] end |
Instance Attribute Details
#backend ⇒ Object
Returns the value of attribute backend.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_search_data.rb', line 19 def backend @backend end |
#db ⇒ Object
Returns the value of attribute db.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_search_data.rb', line 19 def db @db end |
#hits ⇒ Object
Returns the value of attribute hits.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_search_data.rb', line 19 def hits @hits end |
#index_id ⇒ Object
Returns the value of attribute index_id.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_search_data.rb', line 19 def index_id @index_id end |
#query ⇒ Object
Returns the value of attribute query.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_search_data.rb', line 19 def query @query end |
#relation ⇒ Object
Returns the value of attribute relation.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_search_data.rb', line 19 def relation @relation end |
#seed_index ⇒ Object
Returns the value of attribute seed_index.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_search_data.rb', line 19 def seed_index @seed_index end |
#total_matched ⇒ Object
Returns the value of attribute total_matched.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_search_data.rb', line 19 def total_matched @total_matched end |