Class: Slanger::Api::EventPublisher

Inherits:
Struct
  • Object
show all
Defined in:
lib/slanger/api/event_publisher.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#channelsObject

Returns the value of attribute channels

Returns:

  • (Object)

    the current value of channels



3
4
5
# File 'lib/slanger/api/event_publisher.rb', line 3

def channels
  @channels
end

#eventObject

Returns the value of attribute event

Returns:

  • (Object)

    the current value of event



3
4
5
# File 'lib/slanger/api/event_publisher.rb', line 3

def event
  @event
end

Class Method Details

.publish(channels, event) ⇒ Object



4
5
6
# File 'lib/slanger/api/event_publisher.rb', line 4

def self.publish(channels, event)
  new(channels, event).publish
end

Instance Method Details

#publishObject



8
9
10
11
12
# File 'lib/slanger/api/event_publisher.rb', line 8

def publish
  Array(channels).each do |c|
    publish_event(c)
  end
end