Class: Gherkin::Dialect
- Inherits:
-
Object
- Object
- Gherkin::Dialect
- Defined in:
- lib/gherkin/dialect.rb
Class Method Summary collapse
Instance Method Summary collapse
- #and_keywords ⇒ Object
- #background_keywords ⇒ Object
- #but_keywords ⇒ Object
- #examples_keywords ⇒ Object
- #feature_keywords ⇒ Object
- #given_keywords ⇒ Object
-
#initialize(spec) ⇒ Dialect
constructor
A new instance of Dialect.
- #rule_keywords ⇒ Object
- #scenario_keywords ⇒ Object
- #scenario_outline_keywords ⇒ Object
- #then_keywords ⇒ Object
- #when_keywords ⇒ Object
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_keywords ⇒ Object
56 57 58 |
# File 'lib/gherkin/dialect.rb', line 56 def and_keywords @spec.fetch('and') end |
#background_keywords ⇒ Object
40 41 42 |
# File 'lib/gherkin/dialect.rb', line 40 def background_keywords @spec.fetch('background') end |
#but_keywords ⇒ Object
60 61 62 |
# File 'lib/gherkin/dialect.rb', line 60 def but_keywords @spec.fetch('but') end |
#examples_keywords ⇒ Object
36 37 38 |
# File 'lib/gherkin/dialect.rb', line 36 def examples_keywords @spec.fetch('examples') end |
#feature_keywords ⇒ Object
20 21 22 |
# File 'lib/gherkin/dialect.rb', line 20 def feature_keywords @spec.fetch('feature') end |
#given_keywords ⇒ Object
44 45 46 |
# File 'lib/gherkin/dialect.rb', line 44 def given_keywords @spec.fetch('given') end |
#rule_keywords ⇒ Object
24 25 26 |
# File 'lib/gherkin/dialect.rb', line 24 def rule_keywords @spec.fetch('rule') end |
#scenario_keywords ⇒ Object
28 29 30 |
# File 'lib/gherkin/dialect.rb', line 28 def scenario_keywords @spec.fetch('scenario') end |
#scenario_outline_keywords ⇒ Object
32 33 34 |
# File 'lib/gherkin/dialect.rb', line 32 def scenario_outline_keywords @spec.fetch('scenarioOutline') end |
#then_keywords ⇒ Object
52 53 54 |
# File 'lib/gherkin/dialect.rb', line 52 def then_keywords @spec.fetch('then') end |
#when_keywords ⇒ Object
48 49 50 |
# File 'lib/gherkin/dialect.rb', line 48 def when_keywords @spec.fetch('when') end |