Class: Rafflesia::MoleculeFingerprintsData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::MoleculeFingerprintsData
- 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
-
#backend ⇒ Object
Returns the value of attribute backend.
-
#fingerprints ⇒ Object
Returns the value of attribute fingerprints.
-
#molecule_id ⇒ Object
Returns the value of attribute molecule_id.
Instance Method Summary collapse
-
#initialize(json) ⇒ MoleculeFingerprintsData
constructor
A new instance of MoleculeFingerprintsData.
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
#backend ⇒ Object
Returns the value of attribute backend.
14 15 16 |
# File 'lib/rafflesia/molecules/molecule_fingerprints_data.rb', line 14 def backend @backend end |
#fingerprints ⇒ Object
Returns the value of attribute fingerprints.
14 15 16 |
# File 'lib/rafflesia/molecules/molecule_fingerprints_data.rb', line 14 def fingerprints @fingerprints end |
#molecule_id ⇒ Object
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 |