Class: Guide::ScenarioLayoutView

Inherits:
Object
  • Object
show all
Defined in:
app/view_models/guide/scenario_layout_view.rb

Instance Method Summary collapse

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

#formatObject


26
27
28
# File 'app/view_models/guide/scenario_layout_view.rb', line 26

def format
  @format
end

#inject_javascripts?Boolean

Returns:

  • (Boolean)

38
39
40
# File 'app/view_models/guide/scenario_layout_view.rb', line 38

def inject_javascripts?
  @format == :html
end

#inject_stylesheets?Boolean

Returns:

  • (Boolean)

30
31
32
# File 'app/view_models/guide/scenario_layout_view.rb', line 30

def inject_stylesheets?
  @format == :html
end

#injected_htmlObject


46
47
48
# File 'app/view_models/guide/scenario_layout_view.rb', line 46

def injected_html
  @injected_html.html_safe
end

#node_javascriptsObject


42
43
44
# File 'app/view_models/guide/scenario_layout_view.rb', line 42

def node_javascripts
  @node.javascripts
end

#node_layout_templateObject


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_viewObject


22
23
24
# File 'app/view_models/guide/scenario_layout_view.rb', line 22

def node_layout_view
  @node.layout_view_model
end

#node_stylesheetsObject


34
35
36
# File 'app/view_models/guide/scenario_layout_view.rb', line 34

def node_stylesheets
  @node.stylesheets
end

#node_titleObject


10
11
12
# File 'app/view_models/guide/scenario_layout_view.rb', line 10

def node_title
  @node_title
end

#scenario_nameObject


14
15
16
# File 'app/view_models/guide/scenario_layout_view.rb', line 14

def scenario_name
  @scenario.name
end