Class: GherkinRuby::AST::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/gherkin_ruby/ast.rb

Direct Known Subclasses

Background, Feature, Scenario, Step, Tag

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



4
5
6
# File 'lib/gherkin_ruby/ast.rb', line 4

def filename
  @filename
end

#lineObject (readonly)

Returns the value of attribute line.



4
5
6
# File 'lib/gherkin_ruby/ast.rb', line 4

def line
  @line
end

Instance Method Details

#accept(visitor) ⇒ Object



6
7
8
9
# File 'lib/gherkin_ruby/ast.rb', line 6

def accept(visitor)
  name = self.class.name.split('::').last
  visitor.send("visit_#{name}".to_sym, self)
end

#pos(filename, line = nil) ⇒ Object



11
12
13
# File 'lib/gherkin_ruby/ast.rb', line 11

def pos(filename, line=nil)
  @filename, @line = filename, line
end