Class: Chemicalml::Model::Formula
- Defined in:
- lib/chemicalml/model/formula.rb
Overview
Canonical formula. Three complementary forms: a structured
atom_array, a concise string (e.g. "C 1 H 4 O 1"), or an
inline representation (e.g. LaTeX "H_3C-OH").
Instance Attribute Summary collapse
-
#concise ⇒ Object
Returns the value of attribute concise.
-
#convention ⇒ Object
Returns the value of attribute convention.
-
#count ⇒ Object
Returns the value of attribute count.
-
#dict_ref ⇒ Object
Returns the value of attribute dict_ref.
-
#formal_charge ⇒ Object
Returns the value of attribute formal_charge.
-
#id ⇒ Object
Returns the value of attribute id.
-
#inline ⇒ Object
Returns the value of attribute inline.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(id: nil, concise: nil, inline: nil, formal_charge: nil, count: nil, title: nil, convention: nil, dict_ref: nil) ⇒ Formula
constructor
A new instance of Formula.
- #value_attributes ⇒ Object
Methods inherited from Node
#==, #accept, #children, #hash, short_name
Constructor Details
#initialize(id: nil, concise: nil, inline: nil, formal_charge: nil, count: nil, title: nil, convention: nil, dict_ref: nil) ⇒ Formula
Returns a new instance of Formula.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/chemicalml/model/formula.rb', line 12 def initialize(id: nil, concise: nil, inline: nil, formal_charge: nil, count: nil, title: nil, convention: nil, dict_ref: nil) @id = id @concise = concise @inline = inline @formal_charge = formal_charge @count = count @title = title @convention = convention @dict_ref = dict_ref end |
Instance Attribute Details
#concise ⇒ Object
Returns the value of attribute concise.
9 10 11 |
# File 'lib/chemicalml/model/formula.rb', line 9 def concise @concise end |
#convention ⇒ Object
Returns the value of attribute convention.
9 10 11 |
# File 'lib/chemicalml/model/formula.rb', line 9 def convention @convention end |
#count ⇒ Object
Returns the value of attribute count.
9 10 11 |
# File 'lib/chemicalml/model/formula.rb', line 9 def count @count end |
#dict_ref ⇒ Object
Returns the value of attribute dict_ref.
9 10 11 |
# File 'lib/chemicalml/model/formula.rb', line 9 def dict_ref @dict_ref end |
#formal_charge ⇒ Object
Returns the value of attribute formal_charge.
9 10 11 |
# File 'lib/chemicalml/model/formula.rb', line 9 def formal_charge @formal_charge end |
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/chemicalml/model/formula.rb', line 9 def id @id end |
#inline ⇒ Object
Returns the value of attribute inline.
9 10 11 |
# File 'lib/chemicalml/model/formula.rb', line 9 def inline @inline end |
#title ⇒ Object
Returns the value of attribute title.
9 10 11 |
# File 'lib/chemicalml/model/formula.rb', line 9 def title @title end |
Instance Method Details
#value_attributes ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/chemicalml/model/formula.rb', line 25 def value_attributes { id: id, concise: concise, inline: inline, formal_charge: formal_charge, count: count, title: title, convention: convention, dict_ref: dict_ref } end |