Class: Cucumber::Core::Gherkin::Writer::Gherkin
- Inherits:
-
Object
- Object
- Cucumber::Core::Gherkin::Writer::Gherkin
- Defined in:
- lib/cucumber/core/gherkin/writer.rb
Instance Method Summary collapse
- #build ⇒ Object
- #comment(line) ⇒ Object
- #comment_lines ⇒ Object
- #feature(*args, &source) ⇒ Object
-
#initialize(uri, &source) ⇒ Gherkin
constructor
A new instance of Gherkin.
Constructor Details
#initialize(uri, &source) ⇒ Gherkin
Returns a new instance of Gherkin.
17 18 19 |
# File 'lib/cucumber/core/gherkin/writer.rb', line 17 def initialize(uri, &source) @uri, @source = uri, source end |
Instance Method Details
#build ⇒ Object
36 37 38 39 |
# File 'lib/cucumber/core/gherkin/writer.rb', line 36 def build instance_exec(&@source) Document.new(@uri, @feature.build.join("\n")) end |
#comment(line) ⇒ Object
21 22 23 |
# File 'lib/cucumber/core/gherkin/writer.rb', line 21 def comment(line) comment_lines << "# #{line}" end |
#comment_lines ⇒ Object
25 26 27 |
# File 'lib/cucumber/core/gherkin/writer.rb', line 25 def comment_lines @comment_lines ||= [] end |