class
Cassowary::Variable
- Cassowary::Variable
- Reference
- Object
Overview
An unknown the solver assigns a value to.
#value holds the result of the last Solver#update. Use each variable in one solver
only, since every solver writes its solution into #value.
NOTE == builds a Constraint and != does not compile, so compare variables with
same?, and key a Hash by variables only after calling Hash#compare_by_identity
on it.
Included Modules
Defined in:
cassowary/variable.crConstructors
Instance Method Summary
-
#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.
- #name : String
-
#to_expression : Expression
Returns an expression holding only this variable.
-
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
- #value : Float64
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
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>
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>