Class: Slickr::Renderer
- Inherits:
-
Object
- Object
- Slickr::Renderer
- Defined in:
- lib/slickr/renderer.rb
Overview
Renderers take the current state of an entity and draws it to the screen.
Never Mutate Entities
Renderers should know as little as possible about the entity it’s drawing. They should also never, ever, mutate an entity. They only request information and push a representation of that to the screen.
Instance Attribute Summary collapse
-
#entity ⇒ Object
readonly
Returns the value of attribute entity.
Instance Method Summary collapse
-
#initialize(entity) ⇒ Renderer
constructor
A new instance of Renderer.
- #render ⇒ Object
Constructor Details
#initialize(entity) ⇒ Renderer
Returns a new instance of Renderer.
29 30 31 |
# File 'lib/slickr/renderer.rb', line 29 def initialize(entity) @entity = entity end |
Instance Attribute Details
#entity ⇒ Object (readonly)
Returns the value of attribute entity.
27 28 29 |
# File 'lib/slickr/renderer.rb', line 27 def entity @entity end |
Instance Method Details
#render ⇒ Object
33 34 35 |
# File 'lib/slickr/renderer.rb', line 33 def render raise NotImplementedError end |