Class: ViewSpec::Renderable
- Inherits:
-
Object
- Object
- ViewSpec::Renderable
- Defined in:
- lib/view_spec/renderable.rb
Defined Under Namespace
Classes: CurrentTemplate
Instance Method Summary collapse
-
#initialize(identifier, executable, assigns: {}) ⇒ Renderable
constructor
A new instance of Renderable.
- #render_in(view_context) ⇒ Object
Constructor Details
#initialize(identifier, executable, assigns: {}) ⇒ Renderable
Returns a new instance of Renderable.
9 10 11 12 13 |
# File 'lib/view_spec/renderable.rb', line 9 def initialize(identifier, executable, assigns: {}) @identifier = identifier @executable = executable @assigns = assigns end |
Instance Method Details
#render_in(view_context) ⇒ Object
15 16 17 |
# File 'lib/view_spec/renderable.rb', line 15 def render_in(view_context) render_context(view_context).instance_exec(&@executable)&.strip&.html_safe end |