struct Cassowary::Term

Overview

A variable multiplied by a coefficient.

Included Modules

Defined in:

cassowary/term.cr

Constructors

Instance Method Summary

Instance methods inherited from module Cassowary::Operand

!=(other : Operand | Number) : NoReturn !=, *(other : Number) : Expression *, +(other : Operand) : Expression
+(other : Number) : Expression
+
, -(other : Operand) : Expression
-(other : Number) : Expression
- : Expression
-
, /(other : Number) : Expression /, <=(other : Operand | Number) : Constraint <=, ==(other : Operand | Number) : Constraint ==, >=(other : Operand | Number) : Constraint >=, to_expression : Expression to_expression

Constructor Detail

def self.new(variable : Variable, coefficient : Number = 1.0) #

[View source]

Instance Method Detail

def coefficient : Float64 #

[View source]
def to_expression : Expression #

Returns an expression holding only this term.


[View source]
def to_s(io : IO) : Nil #

Writes the term in readable form, such as 2 * x or -x.


[View source]
def value : Float64 #

Returns the coefficient times the variable's current value.


[View source]
def variable : Variable #

[View source]