Class: Manacle::Constraint::Actuator::Nested

Inherits:
Object
  • Object
show all
Includes:
Manacle::Constraint::Actuator
Defined in:
lib/manacle/constraint/actuator/nested.rb

Instance Method Summary collapse

Methods included from Manacle::Constraint::Actuator

build

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

#constrainObject



32
33
34
# File 'lib/manacle/constraint/actuator/nested.rb', line 32

def constrain
  @constrained ||= build_constraint
end

#levelsObject



28
29
30
# File 'lib/manacle/constraint/actuator/nested.rb', line 28

def levels
  [self.class] + @nested.levels
end

#proxyObject



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

#unconstrainObject



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

def unconstrain
  @nested.unconstrain
end