class Cucumber::Runtime::SupportCode::StepInvoker

Public Class Methods

new(support_code) click to toggle source
# File lib/cucumber/runtime/support_code.rb, line 15
def initialize(support_code)
  @support_code = support_code
end

Public Instance Methods

multiline_arg(step, location) click to toggle source
# File lib/cucumber/runtime/support_code.rb, line 28
def multiline_arg(step, location)
  argument = step[:argument]

  if argument
    if argument[:type] == :DocString
      MultilineArgument.from(argument[:content], location, argument[:content_type])
    else
      MultilineArgument::DataTable.from(argument[:rows].map { |row| row[:cells].map { |cell| cell[:value] } })
    end
  else
    MultilineArgument.from(nil)
  end
end
step(step) click to toggle source
# File lib/cucumber/runtime/support_code.rb, line 23
def step(step)
  location = Core::Ast::Location.of_caller
  @support_code.invoke_dynamic_step(step[:text], multiline_arg(step, location))
end
steps(steps) click to toggle source
# File lib/cucumber/runtime/support_code.rb, line 19
def steps(steps)
  steps.each { |step| step(step) }
end