Sha256: cd7c7cd87f45057b9f4ce065f27aff824e3d47d4e5a53f427dc62a108b2cf1de

Contents?: true

Size: 651 Bytes

Versions: 10

Compression:

Stored size: 651 Bytes

Contents

module Cucumber
  module Ast
    # Holds the value of a comment parsed from a feature file:
    #
    #   # Lorem ipsum
    #   # dolor sit amet
    #
    # This gets parsed into a Comment with value <tt>"# Lorem ipsum\n# dolor sit amet\n"</tt>
    #
    class Comment
      def initialize(value)
        @value = value
      end

      def empty?
        @value.nil? || @value == ""
      end

      def accept(visitor)
        @value.split("\n").each do |line|
          visitor.visit_comment_line(line.strip)
        end
      end
      
      def to_sexp
        (@value.nil? || @value == '') ? nil : [:comment, @value]
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
aslakhellesoy-cucumber-0.3.10 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.11.1 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.11.3 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.11 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.9.4 lib/cucumber/ast/comment.rb
aslakhellesoy-cucumber-0.3.9.5 lib/cucumber/ast/comment.rb
kosmas58-cucumber-0.3.11.3 lib/cucumber/ast/comment.rb
kosmas58-cucumber-0.3.9.4 lib/cucumber/ast/comment.rb
cucumber-0.3.10 lib/cucumber/ast/comment.rb
cucumber-0.3.11 lib/cucumber/ast/comment.rb