Class: Gherkin::Pickles::Compiler

Inherits:
Object
  • Object
show all
Defined in:
lib/gherkin/pickles/compiler.rb

Instance Method Summary collapse

Constructor Details

#initialize(id_generator) ⇒ Compiler

Returns a new instance of Compiler.



4
5
6
# File 'lib/gherkin/pickles/compiler.rb', line 4

def initialize(id_generator)
  @id_generator = id_generator
end

Instance Method Details

#compile(gherkin_document, source) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/gherkin/pickles/compiler.rb', line 8

def compile(gherkin_document, source)
  pickles = []

  return pickles unless gherkin_document.feature
  feature = gherkin_document.feature
  language = feature.language
  tags = feature.tags

  compile_feature(pickles, language, tags, feature, source)
  pickles
end