Class: Rafflesia::MetalSiteRecord
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::MetalSiteRecord
- 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
-
#coordination_number ⇒ Object
Returns the value of attribute coordination_number.
-
#donor_counts ⇒ Object
Returns the value of attribute donor_counts.
-
#element ⇒ Object
Returns the value of attribute element.
-
#geometry ⇒ Object
Returns the value of attribute geometry.
-
#ligands ⇒ Object
Returns the value of attribute ligands.
-
#metal ⇒ Object
Returns the value of attribute metal.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(json) ⇒ MetalSiteRecord
constructor
A new instance of MetalSiteRecord.
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_number ⇒ Object
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_counts ⇒ Object
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 |
#element ⇒ Object
Returns the value of attribute element.
18 19 20 |
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18 def element @element end |
#geometry ⇒ Object
Returns the value of attribute geometry.
18 19 20 |
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18 def geometry @geometry end |
#ligands ⇒ Object
Returns the value of attribute ligands.
18 19 20 |
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18 def ligands @ligands end |
#metal ⇒ Object
Returns the value of attribute metal.
18 19 20 |
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18 def @metal end |
#name ⇒ Object
Returns the value of attribute name.
18 19 20 |
# File 'lib/rafflesia/proteins/metal_site_record.rb', line 18 def name @name end |