Class: Rafflesia::AromaticStackingDetectData

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

Constant Summary collapse

HASH_ATTRS =
{
  max_centroid: :max_centroid,
  pairs: :pairs,
  structure_id: :structure_id,
  summary: :summary
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ AromaticStackingDetectData

Returns a new instance of AromaticStackingDetectData.



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

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @max_centroid = hash[:max_centroid]
  @pairs = (hash[:pairs] || []).map { |item| item ? Rafflesia::AromaticPairRecord.new(item) : nil }
  @structure_id = hash[:structure_id]
  @summary = hash[:summary] ? Rafflesia::AromaticStackingSummaryData.new(hash[:summary]) : nil
end

Instance Attribute Details

#max_centroidObject

Returns the value of attribute max_centroid.



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

def max_centroid
  @max_centroid
end

#pairsObject

Returns the value of attribute pairs.



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

def pairs
  @pairs
end

#structure_idObject

Returns the value of attribute structure_id.



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

def structure_id
  @structure_id
end

#summaryObject

Returns the value of attribute summary.



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

def summary
  @summary
end