Class: Cucumber::Ast::Features

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

Overview

:nodoc:

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

#[](index) ⇒ Object



12
13
14
# File 'lib/cucumber/ast/features.rb', line 12

def [](index)
  @features[index]
end

#accept(visitor) ⇒ Object



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

#add_feature(feature) ⇒ Object



20
21
22
23
# File 'lib/cucumber/ast/features.rb', line 20

def add_feature(feature)
  feature.features = self
  @features << feature
end

#each(&proc) ⇒ Object



16
17
18
# File 'lib/cucumber/ast/features.rb', line 16

def each(&proc)
  @features.each(&proc)
end