module Cucumber::MultilineArgument

Public Class Methods

data_table(data, location) click to toggle source
# File lib/cucumber/multiline_argument.rb, line 34
def data_table(data, location)
  builder.data_table(Core::Ast::DataTable.new(data, location))
end
doc_string(argument, content_type, location) click to toggle source
# File lib/cucumber/multiline_argument.rb, line 30
def doc_string(argument, content_type, location)
  builder.doc_string(Core::Ast::DocString.new(argument, content_type, location))
end
from(argument, location=nil) click to toggle source
# File lib/cucumber/multiline_argument.rb, line 13
def from(argument, location=nil)
  location ||= Core::Ast::Location.of_caller
  case argument
  when String
    doc_string(argument, 'text/plain', location)
  when Array
    location = location.on_line(argument.first.line..argument.last.line)
    data_table(argument.map{ |row| row.cells }, location)
  when DataTable, DocString, None
    argument
  when nil
    None.new
  else
    raise ArgumentError, "Don't know how to convert #{argument.class} #{argument.inspect} into a MultilineArgument"
  end
end
from_core(node) click to toggle source
# File lib/cucumber/multiline_argument.rb, line 9
def from_core(node)
  builder.wrap(node)
end

Private Class Methods

builder() click to toggle source
# File lib/cucumber/multiline_argument.rb, line 40
def builder
  @builder ||= Builder.new
end