Class: ActivePath::Subscribers::Subscriber

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

Direct Known Subclasses

PathHints, ViewInjection

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
# 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
end

#partialObject



13
14
15
# File 'lib/active_path/subscribers/subscriber.rb', line 13

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

#performObject

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/active_path/subscribers/subscriber.rb', line 17

def perform
  raise NotImplementedError
end