Class: Chemicalml::Model::Identifier

Inherits:
Node
  • Object
show all
Defined in:
lib/chemicalml/model/identifier.rb

Overview

An external identifier: InChI, SMILES, CAS-RN, etc. The convention field tags the identifier kind.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, #accept, #children, #hash, short_name

Constructor Details

#initialize(value:, convention: nil, dict_ref: nil) ⇒ Identifier

Returns a new instance of Identifier.



10
11
12
13
14
# File 'lib/chemicalml/model/identifier.rb', line 10

def initialize(value:, convention: nil, dict_ref: nil)
  @value = value
  @convention = convention
  @dict_ref = dict_ref
end

Instance Attribute Details

#conventionObject

Returns the value of attribute convention.



8
9
10
# File 'lib/chemicalml/model/identifier.rb', line 8

def convention
  @convention
end

#dict_refObject

Returns the value of attribute dict_ref.



8
9
10
# File 'lib/chemicalml/model/identifier.rb', line 8

def dict_ref
  @dict_ref
end

#valueObject

Returns the value of attribute value.



8
9
10
# File 'lib/chemicalml/model/identifier.rb', line 8

def value
  @value
end

Instance Method Details

#value_attributesObject



16
17
18
# File 'lib/chemicalml/model/identifier.rb', line 16

def value_attributes
  { value: value, convention: convention, dict_ref: dict_ref }
end