Class: ActivePath::Subscribers::Subscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/active_path/subscribers/subscriber.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bufferObject (readonly)

Returns the value of attribute buffer.



4
5
6
# File 'lib/active_path/subscribers/subscriber.rb', line 4

def buffer
  @buffer
end

#contextObject (readonly)

Returns the value of attribute context.



4
5
6
# File 'lib/active_path/subscribers/subscriber.rb', line 4

def context
  @context
end

#localsObject (readonly)

Returns the value of attribute locals.



4
5
6
# File 'lib/active_path/subscribers/subscriber.rb', line 4

def locals
  @locals
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/active_path/subscribers/subscriber.rb', line 4

def options
  @options
end

Instance Method Details

#call(name, started, finished, unique_id, payload) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/active_path/subscribers/subscriber.rb', line 9

def call(name, started, finished, unique_id, payload)
  @context = payload[:context]
  @buffer = payload[:buffer]
  @options = payload[:options]
  @locals = payload[:locals]
  perform and begin
    @context =
    @buffer =
    @options =
    @locals = nil
  end
end

#partialObject



22
23
24
# File 'lib/active_path/subscribers/subscriber.rb', line 22

def partial
  options.is_a?(Hash) ? options[:partial] : options.to_s
end

#performObject

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/active_path/subscribers/subscriber.rb', line 26

def perform
  raise NotImplementedError
end