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