Module: Activist::Actor::ClassMethods

Defined in:
lib/activist/actor.rb

Instance Method Summary collapse

Instance Method Details

#stream(stream, &block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/activist/actor.rb', line 6

def stream(stream, &block)
  define_method "#{stream}_stream" do
    Activist::Stream.new(stream, self, block)
  end
  
  after_destroy "delete_activist_#{stream}_stream"
  
  private
  
    define_method "delete_activist_#{stream}_stream" do
      send("#{stream}_stream").destroy
    end
end