Sha256: 2f5d3b5c3fbcfe864b6e2ed732639a166936c4d22fe2373d32d840c3015de17a

Contents?: true

Size: 742 Bytes

Versions: 3

Compression:

Stored size: 742 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

3 entries across 3 versions & 1 rubygems

Version Path
cuke_modeler-3.6.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.5.0 lib/cuke_modeler/stepped.rb
cuke_modeler-3.4.0 lib/cuke_modeler/stepped.rb