Class: Rafflesia::MetalSiteRecord

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

Constant Summary collapse

HASH_ATTRS =
{
  coordination_number: :coordination_number,
  donor_counts: :donor_counts,
  element: :element,
  geometry: :geometry,
  ligands: :ligands,
  metal: :metal,
  name: :name
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ MetalSiteRecord

Returns a new instance of MetalSiteRecord.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 27

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @coordination_number = hash[:coordination_number]
  @donor_counts = hash[:donor_counts] || {}
  @element = hash[:element]
  @geometry = hash[:geometry]
  @ligands = (hash[:ligands] || []).map { |item| item ? Rafflesia::MetalLigandRecord.new(item) : nil }
  @metal = hash[:metal] ? Rafflesia::ResiduePointer.new(hash[:metal]) : nil
  @name = hash[:name]
end

Instance Attribute Details

#coordination_numberObject

Returns the value of attribute coordination_number.



18
19
20
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18

def coordination_number
  @coordination_number
end

#donor_countsObject

Returns the value of attribute donor_counts.



18
19
20
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18

def donor_counts
  @donor_counts
end

#elementObject

Returns the value of attribute element.



18
19
20
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18

def element
  @element
end

#geometryObject

Returns the value of attribute geometry.



18
19
20
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18

def geometry
  @geometry
end

#ligandsObject

Returns the value of attribute ligands.



18
19
20
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18

def ligands
  @ligands
end

#metalObject

Returns the value of attribute metal.



18
19
20
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18

def metal
  @metal
end

#nameObject

Returns the value of attribute name.



18
19
20
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18

def name
  @name
end