Sha256: 685e433e1e9cc4b2537309efc580248987f7faf2d193284117b9f7482a70c27e

Contents?: true

Size: 823 Bytes

Versions: 3

Compression:

Stored size: 823 Bytes

Contents

module YARD::CodeObjects
  class StepTransformer < Base

    include Cucumber::LocationHelper

    attr_reader :constants, :keyword, :source, :value
    attr_accessor :steps, :pending, :substeps, :literal_value



    #
    # Set the literal value and the value of the step definition.
    #
    # The literal value is as it appears in the step definition file with any
    # constants. The value, when retrieved will attempt to replace those
    # constants with their regex or string equivalents to hopefully match more
    # steps and step definitions.
    #
    #
    def value=(value)
      @literal_value ||= format_source(value)
      @value = format_source(value)

      @steps = []
    end

    # Generate a regex with the step transformers value
    def regex
      @regex ||= Regexp.new(value)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yard-gherkin-turnip-1.0.2 lib/yard/code_objects/step_transformer.rb
yard-gherkin-turnip-1.0.1 lib/yard/code_objects/step_transformer.rb
yard-gherkin-turnip-1.0.0 lib/yard/code_objects/step_transformer.rb