Class: Rafflesia::CombinedSearchStructureRecord
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::CombinedSearchStructureRecord
- 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
-
#attrs ⇒ Object
Returns the value of attribute attrs.
-
#id ⇒ Object
Returns the value of attribute id.
-
#residues ⇒ Object
Returns the value of attribute residues.
Instance Method Summary collapse
-
#initialize(json) ⇒ CombinedSearchStructureRecord
constructor
A new instance of CombinedSearchStructureRecord.
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
#attrs ⇒ Object
Returns the value of attribute attrs.
14 15 16 |
# File 'lib/rafflesia/search/combined_search_structure_record.rb', line 14 def attrs @attrs end |
#id ⇒ Object
Returns the value of attribute id.
14 15 16 |
# File 'lib/rafflesia/search/combined_search_structure_record.rb', line 14 def id @id end |
#residues ⇒ Object
Returns the value of attribute residues.
14 15 16 |
# File 'lib/rafflesia/search/combined_search_structure_record.rb', line 14 def residues @residues end |