Sha256: eb721fef73fe30855b5cb10cf08b731a0c7ae49c4deb017b601be116523c29c2

Contents?: true

Size: 991 Bytes

Versions: 3

Compression:

Stored size: 991 Bytes

Contents

module YARD::CodeObjects::Cucumber
  class Step < Base

    attr_accessor :comments,
                  :definition,
                  :examples,
                  :keyword,
                  :scenario,
                  :table,
                  :text,
                  :placeholders,
                  :value

    def initialize(namespace, name)
      super(namespace, name.to_s.strip)
      @comments = @definition = @description = @keyword = @table = @text = @value = nil
      @examples = {}
      @placeholders = []
    end

    def has_table?
      !@table.nil?
    end

    def has_text?
      !@text.nil?
    end

    def definition=(stepdef)
      @definition = stepdef

      unless stepdef.steps.map(&:files).include?(files)
        stepdef.steps << self

        stepdef.placeholders.each do |placeholder|
          placeholders << placeholder
          placeholder.steps << self
        end
      end
    end

    def transformed?
      !@placeholders.empty?
    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/cucumber/step.rb
yard-gherkin-turnip-1.0.1 lib/yard/code_objects/cucumber/step.rb
yard-gherkin-turnip-1.0.0 lib/yard/code_objects/cucumber/step.rb