struct Cassowary::Expression

Overview

A linear combination of terms plus a constant.

Included Modules

Defined in:

cassowary/expression.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(terms : Array(Term) = [] of Term, constant : Number = 0.0) #

[View source]
def self.new(constant : Number) : Expression #

Creates an expression holding only constant.


[View source]

Instance Method Detail

def constant : Float64 #

[View source]
def terms : Array(Term) #

[View source]
def to_expression : Expression #

Returns self.


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

Writes the expression in readable form, such as x + 2 * y - 10.


[View source]
def value : Float64 #

Returns the expression evaluated with the variables' current values.


[View source]