Module: Cabin::Publisher

Included in:
Metric, Metrics
Defined in:
lib/cabin/publisher.rb

Overview

This mixin allows you to easily give channel and publish features to a class.

Instance Method Summary collapse

Instance Method Details

#channelObject

Get the channel



12
13
14
# File 'lib/cabin/publisher.rb', line 12

def channel
  return @channel
end

#channel=(channel) ⇒ Object

Set the channel



7
8
9
# File 'lib/cabin/publisher.rb', line 7

def channel=(channel)
  @channel = channel
end

#publish(object) ⇒ Object

Publish to the channel



17
18
19
# File 'lib/cabin/publisher.rb', line 17

def publish(object)
  @channel << object
end