Sha256: 0a90d4a3808ab008439f5438be05599f219484b8ffb02f2b5efeaada41608765

Contents?: true

Size: 809 Bytes

Versions: 6

Compression:

Stored size: 809 Bytes

Contents

class Guide::ScenarioLayoutView
  def initialize(node:, node_title:, scenario:, format:, injected_html:)
    @node = node
    @node_title = node_title
    @scenario = scenario
    @format = format
    @injected_html = injected_html
  end

  def node_title
    @node_title
  end

  def scenario_name
    @scenario.name
  end

  def node_layout_template
    @node.layout_templates[format] || Guide.configuration.default_layout_for_scenarios
  end

  def node_layout_view
    @node.layout_view_model
  end

  def format
    @format
  end

  def inject_stylesheets?
    @format == 'html'
  end

  def node_stylesheets
    @node.stylesheets
  end

  def inject_javascripts?
    @format == 'html'
  end

  def node_javascripts
    @node.javascripts
  end

  def injected_html
    @injected_html.html_safe
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
guide-0.6.0 app/view_models/guide/scenario_layout_view.rb
guide-0.5.0 app/view_models/guide/scenario_layout_view.rb
guide-0.4.1 app/view_models/guide/scenario_layout_view.rb
guide-0.4.0 app/view_models/guide/scenario_layout_view.rb
guide-0.3.2 app/view_models/guide/scenario_layout_view.rb
guide-0.3.1 app/view_models/guide/scenario_layout_view.rb