module CukeModeler::Stepped

@api private

A mix-in module containing methods used by models that represent an element that has steps. Internal helper class.

Attributes

steps[RW]

@api

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 21
def indented_step_text(step)
  step.to_s.split("\n").collect { |line| "  #{line}" }.join("\n")
end
populate_steps(parsed_model_data) click to toggle source
# File lib/cuke_modeler/stepped.rb, line 25
def populate_steps(parsed_model_data)
  return unless parsed_model_data['steps']

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