Class: Rafflesia::CombinedSearchStructureRecord

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/search/combined_search_structure_record.rb

Constant Summary collapse

HASH_ATTRS =
{
  attrs: :attrs,
  id: :id,
  residues: :residues
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CombinedSearchStructureRecord

Returns a new instance of CombinedSearchStructureRecord.



19
20
21
22
23
24
25
# File 'lib/rafflesia/search/combined_search_structure_record.rb', line 19

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @attrs = hash[:attrs] || {}
  @id = hash[:id]
  @residues = (hash[:residues] || []).map { |item| item ? Rafflesia::CombinedSearchStructureResidue.new(item) : nil }
end

Instance Attribute Details

#attrsObject

Returns the value of attribute attrs.



14
15
16
# File 'lib/rafflesia/search/combined_search_structure_record.rb', line 14

def attrs
  @attrs
end

#idObject

Returns the value of attribute id.



14
15
16
# File 'lib/rafflesia/search/combined_search_structure_record.rb', line 14

def id
  @id
end

#residuesObject

Returns the value of attribute residues.



14
15
16
# File 'lib/rafflesia/search/combined_search_structure_record.rb', line 14

def residues
  @residues
end