Sha256: 144b48ae5bf70b1e9a8a49cf0467002d60afba5184dc4c63c6705c609afd7d9a

Contents?: true

Size: 740 Bytes

Versions: 14

Compression:

Stored size: 740 Bytes

Contents

module CukeModeler

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


    # The step models contained by this model
    attr_accessor :steps


    private


    def steps_output_string
      steps.collect { |step| indented_step_text(step) }.join("\n")
    end

    def indented_step_text(step)
      step.to_s.split("\n").collect { |line| "  #{line}" }.join("\n")
    end

    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

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
cuke_modeler-3.20.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.19.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.18.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.17.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.16.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.15.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.14.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.13.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.12.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.11.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.10.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.9.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.8.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.7.0 lib/cuke_modeler/stepped.rb