Sha256: c8ab698b7a3f427899ce74c855786790e25eb3a3b389402cc1f35b7982e349bc

Contents?: true

Size: 414 Bytes

Versions: 2

Compression:

Stored size: 414 Bytes

Contents

class Object
  def resugan(namespace = '', &block)
    current_thread = Thread.current
    current_thread.push_resugan_context(namespace)

    block.call

    context = current_thread.pop_resugan_context
    context.invoke
  end

  def fire(event, params = {})
    current_thread = Thread.current
    if current_thread.resugan_context
      current_thread.resugan_context.register(event, params)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
resugan-0.1.1 lib/resugan/object.rb
resugan-0.1.0 lib/resugan/object.rb