class
Chem::Bond
- Chem::Bond
- Reference
- Object
Overview
A covalent bond between two atoms.
Defined in:
chem/core/bond.crConstructors
-
.new(atom : Atom, other : Atom, order : BondOrder = :single)
Creates a new
Bondwith the given atoms and order.
Instance Method Summary
-
#==(rhs : self) : Bool
Returns
trueif this reference is the same as other. - #atoms : Tuple(Atom, Atom)
-
#bonded?(other : self) : Bool
Returns
trueif the bond shares an atom with other, elsefalse. - #double?(*args, **options)
- #double?(*args, **options, &)
-
#includes?(atom : Atom) : Bool
Returns
trueif the bond includes atom, elsefalse. -
#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
trueif the bond matches the given template, elsefalse. -
#measure : Float64
Returns the bond length 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, &)
Constructor Detail
Creates a new Bond with the given atoms and order.
Instance Method Detail
Returns true if this reference is the same as other. Invokes same?.
Returns true if the bond includes atom, else false.
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#matches?) 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>