Class: ViewSpec::ScenarioPreview
- Defined in:
- lib/view_spec/scenario_preview.rb
Instance Method Summary collapse
- #call(view_context = nil) ⇒ Object (also: #to_s, #to_str)
-
#initialize(entry, executable, **options) ⇒ ScenarioPreview
constructor
A new instance of ScenarioPreview.
- #raw ⇒ Object
Methods inherited from Preview
#params, #render_in, #to_path, #to_url
Constructor Details
#initialize(entry, executable, **options) ⇒ ScenarioPreview
Returns a new instance of ScenarioPreview.
5 6 7 8 |
# File 'lib/view_spec/scenario_preview.rb', line 5 def initialize(entry, executable, **) @executable = executable super(entry, **) end |
Instance Method Details
#call(view_context = nil) ⇒ Object Also known as: to_s, to_str
10 11 12 13 |
# File 'lib/view_spec/scenario_preview.rb', line 10 def call(view_context = nil) @entry.validate_params(@params) @rendered ||= renderer(view_context).render(renderable, layout:) end |
#raw ⇒ Object
15 16 17 |
# File 'lib/view_spec/scenario_preview.rb', line 15 def raw CGI.unescapeHTML(to_s) end |