struct
Cassowary::Expression
- Cassowary::Expression
- Struct
- Value
- Object
Overview
A linear combination of terms plus a constant.
Included Modules
Defined in:
cassowary/expression.crConstructors
- .new(terms : Array(Term) = [] of Term, constant : Number = 0.0)
-
.new(constant : Number) : Expression
Creates an expression holding only constant.
Instance Method Summary
- #constant : Float64
- #terms : Array(Term)
-
#to_expression : Expression
Returns
self. -
#to_s(io : IO) : Nil
Writes the expression in readable form, such as
x + 2 * y - 10. -
#value : Float64
Returns the expression evaluated with the variables' current values.
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
Creates an expression holding only constant.