Class: Chem::MDL::MDLBond

Inherits:
Object
  • Object
show all
Includes:
Bond
Defined in:
lib/chem/db/mdl.rb

Constant Summary collapse

Stereo =
{
  0 => :not_stereo,
  1 => :up,
  3 => :cis_trans,
  4 => :either,
  6 => :down
}
BondType =
{
  1 => :single,
  2 => :double,
  3 => :triple,
  4 => :aromatic,
  5 => :single_or_double,
  6 => :single_or_aromatic,
  7 => :double_or_aromatic,
  8 => :any
}
ReactingCenter =
{
  0  => :unmarked,
  1  => :center,
  -1 => :not,
  2  => :no_change,
  4  => :made_or_broken,
  8  => :order_changes
}
Topology =
{
  0 => :either,
  1 => :ring,
  2 => :chain
}

Instance Attribute Summary

Attributes included from Bond

#color

Instance Method Summary collapse

Methods included from Bond

#to_mdl

Constructor Details

#initialize(line) ⇒ MDLBond

Returns a new instance of MDLBond.



165
# File 'lib/chem/db/mdl.rb', line 165

def initialize(line)  ; @line              = line                                       ; end

Instance Method Details

#bond_typeObject



172
# File 'lib/chem/db/mdl.rb', line 172

def bond_type        ; @v               ||= BondType[self.v]                           ; end

#reacting_centerObject



170
# File 'lib/chem/db/mdl.rb', line 170

def reacting_center  ; @reacting_center ||= ReactingCenter[@line[16..18].to_i]         ; end

#stereoObject



171
# File 'lib/chem/db/mdl.rb', line 171

def stereo           ; @stereo          ||= Stereo[@line[9..11].to_i]                  ; end

#topologyObject



169
# File 'lib/chem/db/mdl.rb', line 169

def topology         ; @topology        ||= Topology[@line[13..15].to_i]               ; end

#vObject



167
# File 'lib/chem/db/mdl.rb', line 167

def v                ; @v               ||= @line[6..8].to_i                           ; end