Class: TurnipFormatter::Renderer::Html::Step

Inherits:
Base
  • Object
show all
Defined in:
lib/turnip_formatter/renderer/html/step.rb

Constant Summary

Constants inherited from Base

Base::TEMPLATE_DIRECTORY

Instance Method Summary collapse

Methods inherited from Base

delegate, #id, #initialize, #render, resource_name, view, #view

Constructor Details

This class inherits a constructor from TurnipFormatter::Renderer::Html::Base

Instance Method Details

#argumentObject



20
21
22
23
24
25
26
27
# File 'lib/turnip_formatter/renderer/html/step.rb', line 20

def argument
  @argument ||= case @resource.argument
                when ::Turnip::Table
                  DataTable.new(@resource.argument).render
                when String
                  DocString.new(@resource.argument).render
                end
end

#extra_informationObject



29
30
31
32
33
# File 'lib/turnip_formatter/renderer/html/step.rb', line 29

def extra_information
  extra_information_templates.map do |template, method|
    template.send(method, @resource)
  end.join("\n")
end

#has_appendix?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/turnip_formatter/renderer/html/step.rb', line 35

def has_appendix?
  !!argument or !extra_information_templates.empty?
end

#keywordObject



16
17
18
# File 'lib/turnip_formatter/renderer/html/step.rb', line 16

def keyword
  @resource.keyword.strip
end