Sha256: 4ea3eaf9c5e62f3808e624f9a576466ea2c5062f89e25e475b72662be14690e4

Contents?: true

Size: 382 Bytes

Versions: 4

Compression:

Stored size: 382 Bytes

Contents

module Husky
  module Ears

    def listen_to(object, listeners = [])
      klass = "#{controller_name.camelize}Responder".constantize
      default = klass.new(self)
      listeners << default
      listeners.each do |listener|
        object.add_listener(listener)
      end
    end

    def interact(interactor)
      listen_to(interactor)
      interactor.run
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
husky-0.0.9 lib/husky/ears.rb
husky-0.0.8 lib/husky/ears.rb
husky-0.0.7 lib/husky/ears.rb
husky-0.0.6 lib/husky/ears.rb