mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-04-28 20:55:35 +08:00
25 lines
393 B
Ruby
25 lines
393 B
Ruby
module RubyMotionQuery
|
|
class ValidationEvent
|
|
def initialize(sender, event, block)
|
|
@sender = sender
|
|
@event = event
|
|
@block = block
|
|
end
|
|
|
|
def fire!
|
|
|
|
if @block
|
|
case @block.arity
|
|
when 2
|
|
@block.call(@sender, self)
|
|
when 1
|
|
@block.call(@sender)
|
|
else
|
|
@block.call
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|