Class: Rafflesia::MetalLigandRecord

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

Constant Summary collapse

HASH_ATTRS =
{
  atom_name: :atom_name,
  distance_angstrom: :distance_angstrom,
  donor_element: :donor_element,
  residue: :residue
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ MetalLigandRecord

Returns a new instance of MetalLigandRecord.



21
22
23
24
25
26
27
28
# File 'lib/rafflesia/proteins/metal_ligand_record.rb', line 21

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @atom_name = hash[:atom_name]
  @distance_angstrom = hash[:distance_angstrom]
  @donor_element = hash[:donor_element]
  @residue = hash[:residue] ? Rafflesia::ResiduePointer.new(hash[:residue]) : nil
end

Instance Attribute Details

#atom_nameObject

Returns the value of attribute atom_name.



15
16
17
# File 'lib/rafflesia/proteins/metal_ligand_record.rb', line 15

def atom_name
  @atom_name
end

#distance_angstromObject

Returns the value of attribute distance_angstrom.



15
16
17
# File 'lib/rafflesia/proteins/metal_ligand_record.rb', line 15

def distance_angstrom
  @distance_angstrom
end

#donor_elementObject

Returns the value of attribute donor_element.



15
16
17
# File 'lib/rafflesia/proteins/metal_ligand_record.rb', line 15

def donor_element
  @donor_element
end

#residueObject

Returns the value of attribute residue.



15
16
17
# File 'lib/rafflesia/proteins/metal_ligand_record.rb', line 15

def residue
  @residue
end