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.



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

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



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

def method_missing(*)
end

Instance Method Details

#background(background) ⇒ Object



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

def background(background)
  @background = background
end

#resultObject



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

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