Class: Rafflesia::MoleculeFingerprintsData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/molecules/molecule_fingerprints_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  backend: :backend,
  fingerprints: :fingerprints,
  molecule_id: :molecule_id
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ MoleculeFingerprintsData

Returns a new instance of MoleculeFingerprintsData.



19
20
21
22
23
24
25
# File 'lib/rafflesia/molecules/molecule_fingerprints_data.rb', line 19

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @backend = hash[:backend]
  @fingerprints = (hash[:fingerprints] || []).map { |item| item ? Rafflesia::MoleculeFingerprint.new(item) : nil }
  @molecule_id = hash[:molecule_id]
end

Instance Attribute Details

#backendObject

Returns the value of attribute backend.



14
15
16
# File 'lib/rafflesia/molecules/molecule_fingerprints_data.rb', line 14

def backend
  @backend
end

#fingerprintsObject

Returns the value of attribute fingerprints.



14
15
16
# File 'lib/rafflesia/molecules/molecule_fingerprints_data.rb', line 14

def fingerprints
  @fingerprints
end

#molecule_idObject

Returns the value of attribute molecule_id.



14
15
16
# File 'lib/rafflesia/molecules/molecule_fingerprints_data.rb', line 14

def molecule_id
  @molecule_id
end