Class: Cucumber::Ast::Features
- Inherits:
-
Object
- Object
- Cucumber::Ast::Features
- Includes:
- Enumerable
- Defined in:
- lib/cucumber/ast/features.rb
Overview
:nodoc:
Instance Attribute Summary (collapse)
-
- (Object) duration
readonly
Returns the value of attribute duration.
Instance Method Summary (collapse)
- - (Object) [](index)
- - (Object) accept(visitor)
- - (Object) add_feature(feature)
- - (Object) each(&proc)
-
- (Features) initialize
constructor
A new instance of Features.
Constructor Details
- (Features) initialize
A new instance of Features
8 9 10 |
# File 'lib/cucumber/ast/features.rb', line 8 def initialize @features = [] end |
Instance Attribute Details
- (Object) duration (readonly)
Returns the value of attribute duration
6 7 8 |
# File 'lib/cucumber/ast/features.rb', line 6 def duration @duration end |
Instance Method Details
- (Object) [](index)
12 13 14 |
# File 'lib/cucumber/ast/features.rb', line 12 def [](index) @features[index] end |
- (Object) accept(visitor)
25 26 27 28 29 30 31 32 |
# File 'lib/cucumber/ast/features.rb', line 25 def accept(visitor) return if Cucumber.wants_to_quit start = Time.now self.each do |feature| visitor.visit_feature(feature) end @duration = Time.now - start end |
- (Object) add_feature(feature)
20 21 22 23 |
# File 'lib/cucumber/ast/features.rb', line 20 def add_feature(feature) feature.features = self @features << feature end |
- (Object) each(&proc)
16 17 18 |
# File 'lib/cucumber/ast/features.rb', line 16 def each(&proc) @features.each(&proc) end |