class Chem::Bond

Overview

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

Included Modules

Defined in:

chem/connectivity.cr

Constructors

Instance Method Summary

Instance methods inherited from module Chem::Connectivity({Chem::Atom, Chem::Atom})

<=>(rhs : self) : Int32 <=>, atoms : {Chem::Atom, Chem::Atom} atoms, includes?(atom : Atom) : Bool includes?, inspect(io : IO) : Nil inspect, measure : Float64 measure, to_s(io : IO) : Nil to_s

Constructor Detail

def self.new(atom : Atom, other : Atom, order : BondOrder = :single) #

Creates a new Bond with the given atoms and order.


[View source]

Instance Method Detail

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

Case equality. This is equivalent to #match?.


[View source]
def bonded?(other : self) : Bool #

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


[View source]
def double?(*args, **options) #

[View source]
def double?(*args, **options, &) #

[View source]
def inspect(io : IO) : Nil #
Description copied from class Reference

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>

[View source]
def 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.


[View source]
def measure : Float64 #

Returns the current value of the bond in angstroms.


[View source]
def order : BondOrder #

[View source]
def order=(order : BondOrder) #

[View source]
def other(atom : Atom) : Atom #

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


[View source]
def single?(*args, **options) #

[View source]
def single?(*args, **options, &) #

[View source]
def to_s(io : IO) : Nil #
Description copied from class Reference

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>

[View source]
def triple?(*args, **options) #

[View source]
def triple?(*args, **options, &) #

[View source]
def zero?(*args, **options) #

[View source]
def zero?(*args, **options, &) #

[View source]