Skip to content

Commit

Permalink
exposed some classes in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
da1nerd committed Jun 11, 2020
1 parent ec6900a commit 52c0a6e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/constraint.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,26 @@ require "./variable_state.cr"
require "./strength.cr"

module Kiwi
# :nodoc:
class Constraint
@expression : Expression
@strength : Float64
@op : RelationalOperator

# :nodoc:
property expression, op
getter strength

# :nodoc:
def initialize(expression : Expression, op : RelationalOperator)
initialize(expression, op, Strength::REQUIRED)
end

# :nodoc:
def initialize(other : Constraint, strength : Float64)
initialize(other.expression, other.op, strength)
end

# :nodoc:
def initialize(expression : Expression, @op : RelationalOperator, strength : Float64)
@expression = reduce(expression)
@strength = Strength.clip(strength)
Expand Down

0 comments on commit 52c0a6e

Please sign in to comment.