class

Chem::Bond

Inherits Chem::Connectivity / Comparable / Reference / Object

A Bond provides a canonical representation of a covalent bond between two atoms.

Constructors

new(atom : Atom, other : Atom, order : BondOrder = :single)

Creates a new Bond with the given atoms and order.

Source

Instance methods

===(bond_t : Templates::Bond) : Bool

Case equality. This is equivalent to #match?.

Source
bonded?(other : self) : Bool

Returns true if the bond shares an atom with other, else false.

Source
double?(*args, **options)
Source
double?(*args, **options, &)
Source
inspect(io : IO) : Nil

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Source
matches?(bond_t : Templates::Bond) : Bool

Returns true if the bond matches the given template, else false.

Check considers both atom matching (see Atom#match?) and bond order.

Source
measure

Returns the current value of the bond in angstroms.

Source
order
Source
order=(order : BondOrder)
Source
other(atom : Atom) : Atom

Returns the atom bonded to atom. Raises Error if atom is not included in the bond.

Source
single?(*args, **options)
Source
single?(*args, **options, &)
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
triple?(*args, **options)
Source
triple?(*args, **options, &)
Source
zero?(*args, **options)
Source
zero?(*args, **options, &)
Source