Class: Crumby::Renderer::Base Abstract
- Inherits:
-
Object
- Object
- Crumby::Renderer::Base
- Defined in:
- lib/crumby/renderer/base.rb
Overview
This class is abstract.
base for renderer
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#trail ⇒ Object
readonly
Returns the value of attribute trail.
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
-
#default_options ⇒ Object
abstract
empty default options.
-
#initialize(trail, view, options) ⇒ Base
constructor
A new instance of Base.
-
#render ⇒ String
render trail.
- #render_entry(entry) ⇒ Object abstract
- #render_list(&block) ⇒ Object abstract
Constructor Details
#initialize(trail, view, options) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 |
# File 'lib/crumby/renderer/base.rb', line 8 def initialize(trail, view, ) @trail = trail @view = view @options = .merge end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/crumby/renderer/base.rb', line 6 def @options end |
#trail ⇒ Object (readonly)
Returns the value of attribute trail.
6 7 8 |
# File 'lib/crumby/renderer/base.rb', line 6 def trail @trail end |
#view ⇒ Object (readonly)
Returns the value of attribute view.
6 7 8 |
# File 'lib/crumby/renderer/base.rb', line 6 def view @view end |
Instance Method Details
#default_options ⇒ Object
This method is abstract.
empty default options
26 27 28 |
# File 'lib/crumby/renderer/base.rb', line 26 def {} end |
#render ⇒ String
render trail
16 17 18 19 20 21 22 |
# File 'lib/crumby/renderer/base.rb', line 16 def render render_list do trail.entries.each do |entry| render_entry(entry) end end end |
#render_entry(entry) ⇒ Object
This method is abstract.
36 37 38 |
# File 'lib/crumby/renderer/base.rb', line 36 def render_entry(entry) raise NotImplementedError end |
#render_list(&block) ⇒ Object
This method is abstract.
31 32 33 |
# File 'lib/crumby/renderer/base.rb', line 31 def render_list(&block) raise NotImplementedError end |