Class: Gherkin::Dialect

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Dialect

Returns a new instance of Dialect.



16
17
18
# File 'lib/gherkin/dialect.rb', line 16

def initialize(spec)
  @spec = spec
end

Class Method Details

.for(name) ⇒ Object



9
10
11
12
13
14
# File 'lib/gherkin/dialect.rb', line 9

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

  new(spec)
end

Instance Method Details

#and_keywordsObject



56
57
58
# File 'lib/gherkin/dialect.rb', line 56

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

#background_keywordsObject



40
41
42
# File 'lib/gherkin/dialect.rb', line 40

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

#but_keywordsObject



60
61
62
# File 'lib/gherkin/dialect.rb', line 60

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

#examples_keywordsObject



36
37
38
# File 'lib/gherkin/dialect.rb', line 36

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

#feature_keywordsObject



20
21
22
# File 'lib/gherkin/dialect.rb', line 20

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

#given_keywordsObject



44
45
46
# File 'lib/gherkin/dialect.rb', line 44

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

#rule_keywordsObject



24
25
26
# File 'lib/gherkin/dialect.rb', line 24

def rule_keywords
  @spec.fetch('rule')
end

#scenario_keywordsObject



28
29
30
# File 'lib/gherkin/dialect.rb', line 28

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

#scenario_outline_keywordsObject



32
33
34
# File 'lib/gherkin/dialect.rb', line 32

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

#then_keywordsObject



52
53
54
# File 'lib/gherkin/dialect.rb', line 52

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

#when_keywordsObject



48
49
50
# File 'lib/gherkin/dialect.rb', line 48

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