class Chem::Bond
- Chem::Bond
- Reference
- Object
Overview
A Bond
provides a canonical representation of a covalent bond
between two atoms.
Included Modules
Defined in:
chem/connectivity.crConstructors
-
.new(atom : Atom, other : Atom, order : BondOrder = :single)
Creates a new
Bond
with the given atoms and order.
Instance Method Summary
-
#===(bond_t : Templates::Bond) : Bool
Case equality.
-
#bonded?(other : self) : Bool
Returns
true
if the bond shares an atom with other, elsefalse
. - #double?(*args, **options)
- #double?(*args, **options, &)
-
#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.
-
#matches?(bond_t : Templates::Bond) : Bool
Returns
true
if the bond matches the given template, elsefalse
. -
#measure : Float64
Returns the current value of the bond in angstroms.
- #order : BondOrder
- #order=(order : BondOrder)
-
#other(atom : Atom) : Atom
Returns the atom bonded to atom.
- #single?(*args, **options)
- #single?(*args, **options, &)
-
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
- #triple?(*args, **options)
- #triple?(*args, **options, &)
- #zero?(*args, **options)
- #zero?(*args, **options, &)
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
Creates a new Bond
with the given atoms and order.
Instance Method Detail
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>
Returns true
if the bond matches the given template, else
false
.
Check considers both atom matching (see Atom#match?
) and bond
order.
Returns the atom bonded to atom. Raises Error
if atom is not
included in the bond.
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>