Class: Navigatrix::Renderer
- Inherits:
-
Object
- Object
- Navigatrix::Renderer
- Defined in:
- lib/navigatrix/renderer.rb
Defined Under Namespace
Classes: MissingStrategy
Constant Summary collapse
- REGISTERED_STRATEGIES =
{ :unordered_list => Rendering::Strategies::List, :bootstrap_navbar => Rendering::Strategies::Bootstrap::, :bootstrap_tabs => Rendering::Strategies::Bootstrap::Tabs }
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#render_context ⇒ Object
readonly
Returns the value of attribute render_context.
-
#render_options ⇒ Object
readonly
Returns the value of attribute render_options.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Instance Method Summary collapse
-
#initialize(configuration, options) ⇒ Renderer
constructor
A new instance of Renderer.
- #render ⇒ Object
Constructor Details
#initialize(configuration, options) ⇒ Renderer
Returns a new instance of Renderer.
18 19 20 21 22 23 |
# File 'lib/navigatrix/renderer.rb', line 18 def initialize(configuration, ) @configuration = configuration @strategy = find_strategy(.delete(:strategy)) @render_context = Rendering::Context.new(.delete(:render_context)) = end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
8 9 10 |
# File 'lib/navigatrix/renderer.rb', line 8 def configuration @configuration end |
#render_context ⇒ Object (readonly)
Returns the value of attribute render_context.
8 9 10 |
# File 'lib/navigatrix/renderer.rb', line 8 def render_context @render_context end |
#render_options ⇒ Object (readonly)
Returns the value of attribute render_options.
8 9 10 |
# File 'lib/navigatrix/renderer.rb', line 8 def end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
8 9 10 |
# File 'lib/navigatrix/renderer.rb', line 8 def strategy @strategy end |
Instance Method Details
#render ⇒ Object
25 26 27 |
# File 'lib/navigatrix/renderer.rb', line 25 def render strategy.new(item_collection.items, ).render end |