Class: AsciiChem::Model::ZMatrix

Inherits:
Node
  • Object
show all
Defined in:
lib/asciichem/model/zmatrix.rb

Overview

A Z-Matrix: internal coordinates (bond lengths, angles, torsions).

Syntax:

zmatrix{
C1
H2  C1  1.09
H3  C1  1.09  H2  109.5
H4  C1  1.09  H2  109.5  H3  120.0
}

Defined Under Namespace

Classes: ZRow

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, #accept, #hash, short_name, #to_cml, #to_html, #to_latex, #to_mathml, #to_svg, #to_text

Constructor Details

#initialize(rows: []) ⇒ ZMatrix

Returns a new instance of ZMatrix.



19
20
21
# File 'lib/asciichem/model/zmatrix.rb', line 19

def initialize(rows: [])
  @rows = rows
end

Instance Attribute Details

#rowsObject

Returns the value of attribute rows.



17
18
19
# File 'lib/asciichem/model/zmatrix.rb', line 17

def rows
  @rows
end

Instance Method Details

#childrenObject



27
28
29
# File 'lib/asciichem/model/zmatrix.rb', line 27

def children
  []
end

#diagnostic_labelObject



31
32
33
# File 'lib/asciichem/model/zmatrix.rb', line 31

def diagnostic_label
  "ZMatrix(#{rows.length} rows)"
end

#value_attributesObject



23
24
25
# File 'lib/asciichem/model/zmatrix.rb', line 23

def value_attributes
  { rows: rows }
end