Class: Rafflesia::HelixHydrophobicMomentData

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

Constant Summary collapse

HASH_ATTRS =
{
  angle_degrees: :angle_degrees,
  helices: :helices,
  helix_count: :helix_count,
  structure_id: :structure_id
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ HelixHydrophobicMomentData

Returns a new instance of HelixHydrophobicMomentData.



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

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @angle_degrees = hash[:angle_degrees]
  @helices = (hash[:helices] || []).map { |item| item ? Rafflesia::HelixAmphipathicityRecord.new(item) : nil }
  @helix_count = hash[:helix_count]
  @structure_id = hash[:structure_id]
end

Instance Attribute Details

#angle_degreesObject

Returns the value of attribute angle_degrees.



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

def angle_degrees
  @angle_degrees
end

#helicesObject

Returns the value of attribute helices.



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

def helices
  @helices
end

#helix_countObject

Returns the value of attribute helix_count.



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

def helix_count
  @helix_count
end

#structure_idObject

Returns the value of attribute structure_id.



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

def structure_id
  @structure_id
end