Class: Cassowary::Constraint

Inherits:
Object
  • Object
show all
Defined in:
lib/constraint.rb

Direct Known Subclasses

EditOrStayConstraint, LinearConstraint

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#strengthObject

Returns the value of attribute strength.



5
6
7
# File 'lib/constraint.rb', line 5

def strength
  @strength
end

#weightObject

Returns the value of attribute weight.



5
6
7
# File 'lib/constraint.rb', line 5

def weight
  @weight
end

Instance Method Details

#edit_constraint?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/constraint.rb', line 11

def edit_constraint?
  false
end

#expressionObject

Raises:

  • (NotImplementedError)


7
8
9
# File 'lib/constraint.rb', line 7

def expression
  raise NotImplementedError, "my subclass should have implemented #expression"
end

#inequality?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/constraint.rb', line 15

def inequality?
  false
end

#required?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/constraint.rb', line 19

def required?
  strength.required?
end

#stay_constraint?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/constraint.rb', line 23

def stay_constraint?
  false
end