Class: Wx::EvtHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/fugit/messages.rb,
lib/fugit/main_frame.rb

Instance Method Summary collapse

Instance Method Details

#register_for_message(message, method = nil, &block) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/fugit/messages.rb', line 4

def register_for_message(message, method = nil, &block)
  raise "Must pass method or block" unless block || method

  block ||= Proc.new {|*args| self.send(method, *args)}
  @@message_blocks ||= {}
  @@message_blocks[message] ||= []
  @@message_blocks[message] << block
end

#repoObject



6
7
8
# File 'lib/fugit/main_frame.rb', line 6

def repo
  @@repo
end

#repo=(val) ⇒ Object



10
11
12
# File 'lib/fugit/main_frame.rb', line 10

def repo=(val)
  @@repo = val
end

#send_message(message, *args) ⇒ Object



13
14
15
16
# File 'lib/fugit/messages.rb', line 13

def send_message(message, *args)
  blocks = @@message_blocks[message] || []
  blocks.each {|block| block.call(*args)}
end