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.



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

def initialize(spec)
  @spec = spec
end

Class Method Details

.for(name) ⇒ Object



9
10
11
12
13
# 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



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

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

#background_keywordsObject



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

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

#but_keywordsObject



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

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

#examples_keywordsObject



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

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

#feature_keywordsObject



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

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

#given_keywordsObject



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

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

#rule_keywordsObject



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

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

#scenario_keywordsObject



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

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

#scenario_outline_keywordsObject



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

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

#then_keywordsObject



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

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

#when_keywordsObject



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

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