Sha256: 73ddb96e624b1d190ed8c312a75408a9457bd021bc960f48b590d3fc92c37c37

Contents?: true

Size: 572 Bytes

Versions: 2

Compression:

Stored size: 572 Bytes

Contents

require "attentive/version"
require "attentive/config"

module Attentive
  extend Attentive::Config

  # Default configuration
  self.invocations = ["@me".freeze]


  # Attentive DSL

  def listeners
    @listeners ||= Attentive::ListenerCollection.new
  end

  def listen_for(*args, &block)
    listeners.listen_for(*args, &block)
  end

  def hear(message, params={})
    message = Attentive::Message.new(message, params) unless message.is_a?(Attentive::Message)
    listeners.hear message
  end

end

require "attentive/listener_collection"
require "attentive/message"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
attentive-0.1.1 lib/attentive.rb
attentive-0.1.0 lib/attentive.rb