Class: Rafflesia::ResidueRotamersData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/proteins/residue_rotamers_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  residues: :residues,
  structure_id: :structure_id,
  summary: :summary
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ResidueRotamersData

Returns a new instance of ResidueRotamersData.



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

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @residues = (hash[:residues] || []).map { |item| item ? Rafflesia::RotamerResidueRecord.new(item) : nil }
  @structure_id = hash[:structure_id]
  @summary = hash[:summary] ? Rafflesia::RotamerSummaryData.new(hash[:summary]) : nil
end

Instance Attribute Details

#residuesObject

Returns the value of attribute residues.



14
15
16
# File 'lib/rafflesia/proteins/residue_rotamers_data.rb', line 14

def residues
  @residues
end

#structure_idObject

Returns the value of attribute structure_id.



14
15
16
# File 'lib/rafflesia/proteins/residue_rotamers_data.rb', line 14

def structure_id
  @structure_id
end

#summaryObject

Returns the value of attribute summary.



14
15
16
# File 'lib/rafflesia/proteins/residue_rotamers_data.rb', line 14

def summary
  @summary
end