Class: Druzy::MVC::PropertyChangeListener

Inherits:
Object
  • Object
show all
Defined in:
lib/druzy/mvc/event.rb

Direct Known Subclasses

View

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ PropertyChangeListener

Returns a new instance of PropertyChangeListener.



5
6
7
8
9
10
# File 'lib/druzy/mvc/event.rb', line 5

def initialize(&block)
  @block = nil
  if block_given?
    @block = block
  end
end

Instance Method Details

#property_change(property_change_event) ⇒ Object



12
13
14
# File 'lib/druzy/mvc/event.rb', line 12

def property_change(property_change_event)
  @block.call(property_change_event) if @block!=nil
end