Class: Gherkin3::Dialect

Inherits:
Object
  • Object
show all
Defined in:
lib/gherkin3/dialect.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Dialect

Returns a new instance of Dialect.



14
15
16
# File 'lib/gherkin3/dialect.rb', line 14

def initialize(spec)
  @spec = spec
end

Class Method Details

.for(name) ⇒ Object



8
9
10
11
12
# File 'lib/gherkin3/dialect.rb', line 8

def self.for(name)
  spec = DIALECTS[name]
  return nil unless spec
  new(spec)
end

Instance Method Details

#and_keywordsObject



50
51
52
# File 'lib/gherkin3/dialect.rb', line 50

def and_keywords
  @spec.fetch('and')
end

#background_keywordsObject



34
35
36
# File 'lib/gherkin3/dialect.rb', line 34

def background_keywords
  @spec.fetch('background')
end

#but_keywordsObject



54
55
56
# File 'lib/gherkin3/dialect.rb', line 54

def but_keywords
  @spec.fetch('but')
end

#examples_keywordsObject



30
31
32
# File 'lib/gherkin3/dialect.rb', line 30

def examples_keywords
  @spec.fetch('examples')
end

#feature_keywordsObject



18
19
20
# File 'lib/gherkin3/dialect.rb', line 18

def feature_keywords
  @spec.fetch('feature')
end

#given_keywordsObject



38
39
40
# File 'lib/gherkin3/dialect.rb', line 38

def given_keywords
  @spec.fetch('given')
end

#scenario_keywordsObject



22
23
24
# File 'lib/gherkin3/dialect.rb', line 22

def scenario_keywords
  @spec.fetch('scenario')
end

#scenario_outline_keywordsObject



26
27
28
# File 'lib/gherkin3/dialect.rb', line 26

def scenario_outline_keywords
  @spec.fetch('scenarioOutline')
end

#then_keywordsObject



46
47
48
# File 'lib/gherkin3/dialect.rb', line 46

def then_keywords
  @spec.fetch('then')
end

#when_keywordsObject



42
43
44
# File 'lib/gherkin3/dialect.rb', line 42

def when_keywords
  @spec.fetch('when')
end