Class: Interapp::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/interapp/configuration.rb

Constant Summary collapse

VALID_CONFIG_KEYS =
[:identifier, :private_key, :handler, :peers]

Instance Method Summary collapse

Instance Method Details

#add_peer {|peer| ... } ⇒ Object

Yields:

  • (peer)


11
12
13
14
15
16
# File 'lib/interapp/configuration.rb', line 11

def add_peer
  peer = Interapp::Peer.new
  yield(peer)
  @peers ||= []
  @peers << peer
end

#on_receive(&block) ⇒ Object



7
8
9
# File 'lib/interapp/configuration.rb', line 7

def on_receive(&block)
  @handler = block
end