Class: Rafflesia::StructurePrincipalAxesData

Inherits:
Types::BaseModel
  • Object
show all
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

Instance Method Summary collapse

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_countObject

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

#axesObject

Returns the value of attribute axes.



17
18
19
# File 'lib/rafflesia/proteins/structure_principal_axes_data.rb', line 17

def axes
  @axes
end

#centroidObject

Returns the value of attribute centroid.



17
18
19
# File 'lib/rafflesia/proteins/structure_principal_axes_data.rb', line 17

def centroid
  @centroid
end

#relationObject

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_versionObject

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_idObject

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