module CukeModeler::Stepped

NOT A PART OF THE PUBLIC API A mix-in module containing methods used by models that represent an element that has steps.

Attributes

steps[RW]

The step models contained by this model

Private Instance Methods

indented_step_text(step) click to toggle source
# File lib/cuke_modeler/stepped.rb, line 19
def indented_step_text(step)
  step.to_s.split("\n").collect { |line| "  #{line}" }.join("\n")
end
populate_steps(model, parsed_model_data) click to toggle source
# File lib/cuke_modeler/stepped.rb, line 23
def populate_steps(model, parsed_model_data)
  return unless parsed_model_data['steps']

  parsed_model_data['steps'].each do |step_data|
    model.steps << build_child_model(Step, step_data)
  end
end
steps_output_string() click to toggle source
# File lib/cuke_modeler/stepped.rb, line 15
def steps_output_string
  steps.collect { |step| indented_step_text(step) }.join("\n")
end