Class: Rafflesia::MoleculeImportData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::MoleculeImportData
- Defined in:
- lib/rafflesia/molecules/molecule_import_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ atom_count: :atom_count, bond_count: :bond_count, format: :format, molecule_id: :molecule_id, object: :object, record_count: :record_count, source_id: :source_id }.freeze
Instance Attribute Summary collapse
-
#atom_count ⇒ Object
Returns the value of attribute atom_count.
-
#bond_count ⇒ Object
Returns the value of attribute bond_count.
-
#format ⇒ Object
Returns the value of attribute format.
-
#molecule_id ⇒ Object
Returns the value of attribute molecule_id.
-
#object ⇒ Object
Returns the value of attribute object.
-
#record_count ⇒ Object
Returns the value of attribute record_count.
-
#source_id ⇒ Object
Returns the value of attribute source_id.
Instance Method Summary collapse
-
#initialize(json) ⇒ MoleculeImportData
constructor
A new instance of MoleculeImportData.
Constructor Details
#initialize(json) ⇒ MoleculeImportData
Returns a new instance of MoleculeImportData.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rafflesia/molecules/molecule_import_data.rb', line 27 def initialize(json) super() hash = self.class.normalize(json) @atom_count = hash[:atom_count] @bond_count = hash[:bond_count] @format = hash[:format] @molecule_id = hash[:molecule_id] @object = hash[:object] ? Rafflesia::ObjectRef.new(hash[:object]) : nil @record_count = hash[:record_count] @source_id = hash[:source_id] end |
Instance Attribute Details
#atom_count ⇒ Object
Returns the value of attribute atom_count.
18 19 20 |
# File 'lib/rafflesia/molecules/molecule_import_data.rb', line 18 def atom_count @atom_count end |
#bond_count ⇒ Object
Returns the value of attribute bond_count.
18 19 20 |
# File 'lib/rafflesia/molecules/molecule_import_data.rb', line 18 def bond_count @bond_count end |
#format ⇒ Object
Returns the value of attribute format.
18 19 20 |
# File 'lib/rafflesia/molecules/molecule_import_data.rb', line 18 def format @format end |
#molecule_id ⇒ Object
Returns the value of attribute molecule_id.
18 19 20 |
# File 'lib/rafflesia/molecules/molecule_import_data.rb', line 18 def molecule_id @molecule_id end |
#object ⇒ Object
Returns the value of attribute object.
18 19 20 |
# File 'lib/rafflesia/molecules/molecule_import_data.rb', line 18 def object @object end |
#record_count ⇒ Object
Returns the value of attribute record_count.
18 19 20 |
# File 'lib/rafflesia/molecules/molecule_import_data.rb', line 18 def record_count @record_count end |
#source_id ⇒ Object
Returns the value of attribute source_id.
18 19 20 |
# File 'lib/rafflesia/molecules/molecule_import_data.rb', line 18 def source_id @source_id end |