Class: Rafflesia::MoleculeInspectData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::MoleculeInspectData
- Defined in:
- lib/rafflesia/molecules/molecule_inspect_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ atom_count: :atom_count, bond_count: :bond_count, format: :format, molecule_id: :molecule_id, objects: :objects, record_count: :record_count }.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.
-
#objects ⇒ Object
Returns the value of attribute objects.
-
#record_count ⇒ Object
Returns the value of attribute record_count.
Instance Method Summary collapse
-
#initialize(json) ⇒ MoleculeInspectData
constructor
A new instance of MoleculeInspectData.
Constructor Details
#initialize(json) ⇒ MoleculeInspectData
Returns a new instance of MoleculeInspectData.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rafflesia/molecules/molecule_inspect_data.rb', line 25 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] @objects = (hash[:objects] || []).map { |item| item ? Rafflesia::ObjectRef.new(item) : nil } @record_count = hash[:record_count] end |
Instance Attribute Details
#atom_count ⇒ Object
Returns the value of attribute atom_count.
17 18 19 |
# File 'lib/rafflesia/molecules/molecule_inspect_data.rb', line 17 def atom_count @atom_count end |
#bond_count ⇒ Object
Returns the value of attribute bond_count.
17 18 19 |
# File 'lib/rafflesia/molecules/molecule_inspect_data.rb', line 17 def bond_count @bond_count end |
#format ⇒ Object
Returns the value of attribute format.
17 18 19 |
# File 'lib/rafflesia/molecules/molecule_inspect_data.rb', line 17 def format @format end |
#molecule_id ⇒ Object
Returns the value of attribute molecule_id.
17 18 19 |
# File 'lib/rafflesia/molecules/molecule_inspect_data.rb', line 17 def molecule_id @molecule_id end |
#objects ⇒ Object
Returns the value of attribute objects.
17 18 19 |
# File 'lib/rafflesia/molecules/molecule_inspect_data.rb', line 17 def objects @objects end |
#record_count ⇒ Object
Returns the value of attribute record_count.
17 18 19 |
# File 'lib/rafflesia/molecules/molecule_inspect_data.rb', line 17 def record_count @record_count end |