Class: Guide::ScenarioLayoutView
- Inherits:
-
Object
- Object
- Guide::ScenarioLayoutView
- Defined in:
- app/view_models/guide/scenario_layout_view.rb
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(node:, node_title:, scenario:, format:, injected_html:) ⇒ ScenarioLayoutView
constructor
A new instance of ScenarioLayoutView.
- #inject_javascripts? ⇒ Boolean
- #inject_stylesheets? ⇒ Boolean
- #injected_html ⇒ Object
- #node_javascripts ⇒ Object
- #node_layout_template ⇒ Object
- #node_layout_view ⇒ Object
- #node_stylesheets ⇒ Object
- #node_title ⇒ Object
- #scenario_name ⇒ Object
Constructor Details
#initialize(node:, node_title:, scenario:, format:, injected_html:) ⇒ ScenarioLayoutView
Returns a new instance of ScenarioLayoutView.
2 3 4 5 6 7 8 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 2 def initialize(node:, node_title:, scenario:, format:, injected_html:) @node = node @node_title = node_title @scenario = scenario @format = format @injected_html = injected_html end |
Instance Method Details
#format ⇒ Object
26 27 28 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 26 def format @format end |
#inject_javascripts? ⇒ Boolean
38 39 40 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 38 def inject_javascripts? @format == :html end |
#inject_stylesheets? ⇒ Boolean
30 31 32 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 30 def inject_stylesheets? @format == :html end |
#injected_html ⇒ Object
46 47 48 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 46 def injected_html @injected_html.html_safe end |
#node_javascripts ⇒ Object
42 43 44 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 42 def node_javascripts @node.javascripts end |
#node_layout_template ⇒ Object
18 19 20 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 18 def node_layout_template @node.layout_templates[format] || Guide.configuration.default_layout_for_scenarios end |
#node_layout_view ⇒ Object
22 23 24 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 22 def node_layout_view @node.layout_view_model end |
#node_stylesheets ⇒ Object
34 35 36 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 34 def node_stylesheets @node.stylesheets end |
#node_title ⇒ Object
10 11 12 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 10 def node_title @node_title end |
#scenario_name ⇒ Object
14 15 16 |
# File 'app/view_models/guide/scenario_layout_view.rb', line 14 def scenario_name @scenario.name end |