Class: Reflex::SnapConstraint
Instance Method Summary
collapse
Methods inherited from Constraint
#pins, #views
Methods included from HasTags
#clear_tags, #tag, #tag=, #tags, #untag
Instance Method Details
#angle ⇒ Object
19
20
21
|
# File 'lib/reflex/snap_constraint.rb', line 19
def angle()
has_angle! ? Range.new(angle_min!, angle_max!) : nil
end
|
#angle=(angle) ⇒ Object
10
11
12
13
14
15
16
17
|
# File 'lib/reflex/snap_constraint.rb', line 10
def angle=(angle)
case angle
when nil then clear_angle!
when Range then set_angle! angle.begin, angle.end
when Numeric then set_angle! angle, angle
else raise ArgumentError, "invalid angle: #{angle.inspect}"
end
end
|