Class: Travis::Client::Listener::EntityListener

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/travis/client/listener.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(listener, entities) ⇒ EntityListener

Returns a new instance of EntityListener.



82
83
84
85
# File 'lib/travis/client/listener.rb', line 82

def initialize(listener, entities)
  @listener = listener
  @entities = Array(entities)
end

Instance Attribute Details

#entitiesObject (readonly)

Returns the value of attribute entities.



77
78
79
# File 'lib/travis/client/listener.rb', line 77

def entities
  @entities
end

#listenerObject (readonly)

Returns the value of attribute listener.



77
78
79
# File 'lib/travis/client/listener.rb', line 77

def listener
  @listener
end

Instance Method Details

#on(*events) ⇒ Object



87
88
89
# File 'lib/travis/client/listener.rb', line 87

def on(*events)
  listener.on(*events) { |e| yield(e) if dispatch?(e) }
end