Class: Rafflesia::MoleculeImportData

Inherits:
Types::BaseModel
  • Object
show all
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

Instance Method Summary collapse

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_countObject

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_countObject

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

#formatObject

Returns the value of attribute format.



18
19
20
# File 'lib/rafflesia/molecules/molecule_import_data.rb', line 18

def format
  @format
end

#molecule_idObject

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

#objectObject

Returns the value of attribute object.



18
19
20
# File 'lib/rafflesia/molecules/molecule_import_data.rb', line 18

def object
  @object
end

#record_countObject

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_idObject

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