Class: ActivePath::Renderer::PartialRenderer

Inherits:
Object
  • Object
show all
Includes:
Conditional, PathHints
Defined in:
lib/active_path/renderer/partial_renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PathHints

#end_path_hints, #start_path_hints

Methods included from Conditional

#condition_match?, #conditions_match?, #hash_match?, #proc_match?

Constructor Details

#initialize(context, options = {}) ⇒ PartialRenderer

Returns a new instance of PartialRenderer.



10
11
12
13
# File 'lib/active_path/renderer/partial_renderer.rb', line 10

def initialize(context, options = {})
  @context = context
  @options = options
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



6
7
8
# File 'lib/active_path/renderer/partial_renderer.rb', line 6

def context
  @context
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/active_path/renderer/partial_renderer.rb', line 6

def options
  @options
end

Instance Method Details

#renderObject



15
16
17
18
19
20
# File 'lib/active_path/renderer/partial_renderer.rb', line 15

def render
  output_buffer = yield
  prepend_to(output_buffer)
  append_to(output_buffer)
  output_buffer
end