Class: Navigatrix::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/navigatrix/renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, options) ⇒ Renderer

Returns a new instance of Renderer.



11
12
13
14
15
# File 'lib/navigatrix/renderer.rb', line 11

def initialize(configuration, options)
  @configuration  = configuration
  @render_context = Rendering::Context.new(options.delete(:render_context))
  @render_options = options
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration.



9
10
11
# File 'lib/navigatrix/renderer.rb', line 9

def configuration
  @configuration
end

#render_contextObject (readonly)

Returns the value of attribute render_context.



9
10
11
# File 'lib/navigatrix/renderer.rb', line 9

def render_context
  @render_context
end

#render_optionsObject (readonly)

Returns the value of attribute render_options.



9
10
11
# File 'lib/navigatrix/renderer.rb', line 9

def render_options
  @render_options
end

Instance Method Details

#renderObject



17
18
19
# File 'lib/navigatrix/renderer.rb', line 17

def render
  strategy.new(item_collection.items, list_options, item_options).render
end