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

#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



6
7
8
9
10
11
12
13
# File 'lib/active_path/subscribers/subscriber.rb', line 6

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

#partialObject



15
16
17
# File 'lib/active_path/subscribers/subscriber.rb', line 15

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

#performObject

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/active_path/subscribers/subscriber.rb', line 19

def perform
  raise NotImplementedError
end