Class: AsciiChem::Layout::Result
- Inherits:
-
Struct
- Object
- Struct
- AsciiChem::Layout::Result
- Defined in:
- lib/asciichem/layout.rb
Overview
Layout result: positioned atoms and bonds ready for rendering.
Instance Attribute Summary collapse
-
#atoms ⇒ Object
Returns the value of attribute atoms.
-
#bonds ⇒ Object
Returns the value of attribute bonds.
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
Instance Attribute Details
#atoms ⇒ Object
Returns the value of attribute atoms
33 34 35 |
# File 'lib/asciichem/layout.rb', line 33 def atoms @atoms end |
#bonds ⇒ Object
Returns the value of attribute bonds
33 34 35 |
# File 'lib/asciichem/layout.rb', line 33 def bonds @bonds end |
#height ⇒ Object
Returns the value of attribute height
33 34 35 |
# File 'lib/asciichem/layout.rb', line 33 def height @height end |
#width ⇒ Object
Returns the value of attribute width
33 34 35 |
# File 'lib/asciichem/layout.rb', line 33 def width @width end |
Instance Method Details
#atoms_by_id ⇒ Object
34 35 36 |
# File 'lib/asciichem/layout.rb', line 34 def atoms_by_id @atoms_by_id ||= atoms.to_h { |a| [a.id, a] } end |
#empty? ⇒ Boolean
38 39 40 |
# File 'lib/asciichem/layout.rb', line 38 def empty? atoms.empty? end |