Class: Rafflesia::SecondaryStructureData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::SecondaryStructureData
- Defined in:
- lib/rafflesia/proteins/secondary_structure_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ chains: :chains, relation: :relation, residue_count: :residue_count, residues: :residues, structure_id: :structure_id, summary: :summary }.freeze
Instance Attribute Summary collapse
-
#chains ⇒ Object
Returns the value of attribute chains.
-
#relation ⇒ Object
Returns the value of attribute relation.
-
#residue_count ⇒ Object
Returns the value of attribute residue_count.
-
#residues ⇒ Object
Returns the value of attribute residues.
-
#structure_id ⇒ Object
Returns the value of attribute structure_id.
-
#summary ⇒ Object
Returns the value of attribute summary.
Instance Method Summary collapse
-
#initialize(json) ⇒ SecondaryStructureData
constructor
A new instance of SecondaryStructureData.
Constructor Details
#initialize(json) ⇒ SecondaryStructureData
Returns a new instance of SecondaryStructureData.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rafflesia/proteins/secondary_structure_data.rb', line 25 def initialize(json) super() hash = self.class.normalize(json) @chains = (hash[:chains] || []).map { |item| item ? Rafflesia::SecondaryStructureChain.new(item) : nil } @relation = hash[:relation] ? Rafflesia::RelationArtifactData.new(hash[:relation]) : nil @residue_count = hash[:residue_count] @residues = (hash[:residues] || []).map { |item| item ? Rafflesia::SecondaryStructureResidue.new(item) : nil } @structure_id = hash[:structure_id] @summary = hash[:summary] ? Rafflesia::SecondaryStructureSummary.new(hash[:summary]) : nil end |
Instance Attribute Details
#chains ⇒ Object
Returns the value of attribute chains.
17 18 19 |
# File 'lib/rafflesia/proteins/secondary_structure_data.rb', line 17 def chains @chains end |
#relation ⇒ Object
Returns the value of attribute relation.
17 18 19 |
# File 'lib/rafflesia/proteins/secondary_structure_data.rb', line 17 def relation @relation end |
#residue_count ⇒ Object
Returns the value of attribute residue_count.
17 18 19 |
# File 'lib/rafflesia/proteins/secondary_structure_data.rb', line 17 def residue_count @residue_count end |
#residues ⇒ Object
Returns the value of attribute residues.
17 18 19 |
# File 'lib/rafflesia/proteins/secondary_structure_data.rb', line 17 def residues @residues end |
#structure_id ⇒ Object
Returns the value of attribute structure_id.
17 18 19 |
# File 'lib/rafflesia/proteins/secondary_structure_data.rb', line 17 def structure_id @structure_id end |
#summary ⇒ Object
Returns the value of attribute summary.
17 18 19 |
# File 'lib/rafflesia/proteins/secondary_structure_data.rb', line 17 def summary @summary end |