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