Class: MotionBindable::Strategies::Proc

Inherits:
MotionBindable::Strategy show all
Defined in:
lib/strategies/proc.rb

Constant Summary

Constants inherited from MotionBindable::Strategy

MotionBindable::Strategy::WATCH_TICK

Instance Attribute Summary

Attributes inherited from MotionBindable::Strategy

#bound, #object

Instance Method Summary collapse

Methods inherited from MotionBindable::Strategy

#bind, find_by_reference, #initialize, #refresh_object, register_strategy, #unbind

Constructor Details

This class inherits a constructor from MotionBindable::Strategy

Instance Method Details

#on_bound_change(new = nil) ⇒ Object



9
10
11
# File 'lib/strategies/proc.rb', line 9

def on_bound_change(new = nil)
  self.attribute = new || bound.call
end

#refresh_boundObject



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

def refresh_bound
  bound.call
end