Class: Cucumber::Core::Ast::BackgroundFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/core/ast/feature.rb

Instance Method Summary collapse

Constructor Details

#initialize(feature_elements) ⇒ BackgroundFinder

Returns a new instance of BackgroundFinder.



69
70
71
72
# File 'lib/cucumber/core/ast/feature.rb', line 69

def initialize(feature_elements)
  @background = nil
  feature_elements[0].describe_to(self) unless feature_elements.empty?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missingObject



82
83
# File 'lib/cucumber/core/ast/feature.rb', line 82

def method_missing(*)
end

Instance Method Details

#background(background) ⇒ Object



74
75
76
# File 'lib/cucumber/core/ast/feature.rb', line 74

def background(background)
  @background = background
end

#resultObject



78
79
80
# File 'lib/cucumber/core/ast/feature.rb', line 78

def result
  @background ? @background : EmptyBackground.new
end