Class: Cucumber::Ast::Features
- Includes:
- Enumerable
- Defined in:
- lib/cucumber/ast/features.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #add_feature(feature) ⇒ Object
- #each(&proc) ⇒ Object
-
#initialize ⇒ Features
constructor
A new instance of Features.
Constructor Details
#initialize ⇒ Features
Returns a new instance of Features.
8 9 10 |
# File 'lib/cucumber/ast/features.rb', line 8 def initialize @features = [] end |
Instance Attribute Details
#duration ⇒ Object (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
#accept(visitor) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/cucumber/ast/features.rb', line 21 def accept(visitor) start = Time.now @features.each do |feature| visitor.visit_feature(feature) end @duration = Time.now - start end |
#add_feature(feature) ⇒ Object
16 17 18 19 |
# File 'lib/cucumber/ast/features.rb', line 16 def add_feature(feature) feature.features = self @features << feature end |
#each(&proc) ⇒ Object
12 13 14 |
# File 'lib/cucumber/ast/features.rb', line 12 def each(&proc) @features.each(&proc) end |