Class: Cucumber::Ast::Features

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/cucumber/ast/features.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFeatures

Returns a new instance of Features.



8
9
10
# File 'lib/cucumber/ast/features.rb', line 8

def initialize
  @features = []
end

Instance Attribute Details

#durationObject (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