Class: ChemScanner::ChemDraw::Parser
- Inherits:
-
Object
- Object
- ChemScanner::ChemDraw::Parser
- Defined in:
- lib/chem_scanner/chem_draw/parser.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#bracket_map ⇒ Object
readonly
Returns the value of attribute bracket_map.
-
#color_table ⇒ Object
readonly
Returns the value of attribute color_table.
-
#font_table ⇒ Object
readonly
Returns the value of attribute font_table.
-
#fragment_group_map ⇒ Object
readonly
Returns the value of attribute fragment_group_map.
-
#fragment_map ⇒ Object
readonly
Returns the value of attribute fragment_map.
-
#geometry_map ⇒ Object
readonly
Returns the value of attribute geometry_map.
-
#graphic_map ⇒ Object
readonly
Returns the value of attribute graphic_map.
-
#molecules ⇒ Object
readonly
Returns the value of attribute molecules.
-
#reactions ⇒ Object
readonly
Returns the value of attribute reactions.
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
-
#tempid ⇒ Object
readonly
Returns the value of attribute tempid.
-
#text_map ⇒ Object
readonly
Returns the value of attribute text_map.
Instance Method Summary collapse
- #fragment_as_line ⇒ Object
- #get_tempid ⇒ Object
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #n_atoms ⇒ Object
- #read ⇒ Object
Constructor Details
#initialize ⇒ Parser
Returns a new instance of Parser.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 25 def initialize # Start a new tempid to avoid duplicate with existed id @tempid = 10_000_000 # Value from ChemDraw file, no OBMol yet @fragment_map = ElementMap.new @fragment_group_map = ElementMap.new @geometry_map = ElementMap.new @graphic_map = ElementMap.new @text_map = ElementMap.new @bracket_map = ElementMap.new # Real output @reactions = [] @molecules = [] # parser type (cdx, cdxml) @type = "" end |
Instance Attribute Details
#bracket_map ⇒ Object (readonly)
Returns the value of attribute bracket_map.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def bracket_map @bracket_map end |
#color_table ⇒ Object (readonly)
Returns the value of attribute color_table.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def color_table @color_table end |
#font_table ⇒ Object (readonly)
Returns the value of attribute font_table.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def font_table @font_table end |
#fragment_group_map ⇒ Object (readonly)
Returns the value of attribute fragment_group_map.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def fragment_group_map @fragment_group_map end |
#fragment_map ⇒ Object (readonly)
Returns the value of attribute fragment_map.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def fragment_map @fragment_map end |
#geometry_map ⇒ Object (readonly)
Returns the value of attribute geometry_map.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def geometry_map @geometry_map end |
#graphic_map ⇒ Object (readonly)
Returns the value of attribute graphic_map.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def graphic_map @graphic_map end |
#molecules ⇒ Object (readonly)
Returns the value of attribute molecules.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def molecules @molecules end |
#reactions ⇒ Object (readonly)
Returns the value of attribute reactions.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def reactions @reactions end |
#reader ⇒ Object (readonly)
Returns the value of attribute reader.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def reader @reader end |
#tempid ⇒ Object (readonly)
Returns the value of attribute tempid.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def tempid @tempid end |
#text_map ⇒ Object (readonly)
Returns the value of attribute text_map.
20 21 22 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 20 def text_map @text_map end |
Instance Method Details
#fragment_as_line ⇒ Object
58 59 60 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 58 def fragment_as_line @scheme&.fragment_as_line end |
#get_tempid ⇒ Object
49 50 51 52 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 49 def get_tempid @tempid += 1 @tempid - 1 end |
#n_atoms ⇒ Object
54 55 56 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 54 def n_atoms @scheme&.n_atoms end |
#read ⇒ Object
47 |
# File 'lib/chem_scanner/chem_draw/parser.rb', line 47 def read; end |