Class: Rafflesia::StructurePredictionEntity

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/foundry/structure_prediction_entity.rb

Constant Summary collapse

HASH_ATTRS =
{
  ccd: :ccd,
  id: :id,
  modifications: :modifications,
  sequence: :sequence,
  smiles: :smiles,
  type: :type
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ StructurePredictionEntity

Returns a new instance of StructurePredictionEntity.



25
26
27
28
29
30
31
32
33
34
# File 'lib/rafflesia/foundry/structure_prediction_entity.rb', line 25

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @ccd = (hash[:ccd] || [])
  @id = hash[:id]
  @modifications = (hash[:modifications] || []).map { |item| item ? Rafflesia::StructurePredictionModification.new(item) : nil }
  @sequence = hash[:sequence]
  @smiles = hash[:smiles]
  @type = hash[:type]
end

Instance Attribute Details

#ccdObject

Returns the value of attribute ccd.



17
18
19
# File 'lib/rafflesia/foundry/structure_prediction_entity.rb', line 17

def ccd
  @ccd
end

#idObject

Returns the value of attribute id.



17
18
19
# File 'lib/rafflesia/foundry/structure_prediction_entity.rb', line 17

def id
  @id
end

#modificationsObject

Returns the value of attribute modifications.



17
18
19
# File 'lib/rafflesia/foundry/structure_prediction_entity.rb', line 17

def modifications
  @modifications
end

#sequenceObject

Returns the value of attribute sequence.



17
18
19
# File 'lib/rafflesia/foundry/structure_prediction_entity.rb', line 17

def sequence
  @sequence
end

#smilesObject

Returns the value of attribute smiles.



17
18
19
# File 'lib/rafflesia/foundry/structure_prediction_entity.rb', line 17

def smiles
  @smiles
end

#typeObject

Returns the value of attribute type.



17
18
19
# File 'lib/rafflesia/foundry/structure_prediction_entity.rb', line 17

def type
  @type
end