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.
18 19 20 21 |
# File 'lib/cucumber/core/gherkin/writer.rb', line 18 def initialize(uri, &source) @uri = uri @source = source end |
Instance Method Details
#build ⇒ Object
38 39 40 41 |
# File 'lib/cucumber/core/gherkin/writer.rb', line 38 def build instance_exec(&@source) Document.new(@uri, @feature.build.join("\n")) end |
#comment(line) ⇒ Object
23 24 25 |
# File 'lib/cucumber/core/gherkin/writer.rb', line 23 def comment(line) comment_lines << "# #{line}" end |
#comment_lines ⇒ Object
27 28 29 |
# File 'lib/cucumber/core/gherkin/writer.rb', line 27 def comment_lines @comment_lines ||= [] end |