Class: Manacle::Constraint::Actuator::Nested
- Inherits:
-
Object
- Object
- Manacle::Constraint::Actuator::Nested
- Includes:
- Manacle::Constraint::Actuator
- Defined in:
- lib/manacle/constraint/actuator/nested.rb
Instance Method Summary collapse
- #constrain ⇒ Object
-
#initialize(nested, constraint) ⇒ Nested
constructor
A new instance of Nested.
- #levels ⇒ Object
- #proxy ⇒ Object
- #reconstrain(obj) ⇒ Object
- #unconstrain ⇒ Object
Methods included from Manacle::Constraint::Actuator
Constructor Details
#initialize(nested, constraint) ⇒ Nested
Returns a new instance of Nested.
10 11 12 13 |
# File 'lib/manacle/constraint/actuator/nested.rb', line 10 def initialize(nested, constraint) @nested = nested @constraint = constraint end |
Instance Method Details
#constrain ⇒ Object
32 33 34 |
# File 'lib/manacle/constraint/actuator/nested.rb', line 32 def constrain @constrained ||= build_constraint end |
#levels ⇒ Object
28 29 30 |
# File 'lib/manacle/constraint/actuator/nested.rb', line 28 def levels [self.class] + @nested.levels end |
#proxy ⇒ Object
24 25 26 |
# File 'lib/manacle/constraint/actuator/nested.rb', line 24 def proxy @nested.proxy end |
#reconstrain(obj) ⇒ Object
19 20 21 22 |
# File 'lib/manacle/constraint/actuator/nested.rb', line 19 def reconstrain(obj) res = @nested.reconstrain(obj) self.class.new(res, @constraint) end |
#unconstrain ⇒ Object
15 16 17 |
# File 'lib/manacle/constraint/actuator/nested.rb', line 15 def unconstrain @nested.unconstrain end |