Class: Cucumber::CucumberExpressions::GeneratedExpression

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/generated_expression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression_template, parameters_types) ⇒ GeneratedExpression

Returns a new instance of GeneratedExpression.



6
7
8
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/generated_expression.rb', line 6

def initialize(expression_template, parameters_types)
  @expression_template, @parameter_types = expression_template, parameters_types
end

Instance Attribute Details

#parameter_typesObject (readonly)

Returns the value of attribute parameter_types.



4
5
6
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/generated_expression.rb', line 4

def parameter_types
  @parameter_types
end

Instance Method Details

#parameter_namesObject



14
15
16
17
18
19
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/generated_expression.rb', line 14

def parameter_names
  usage_by_type_name = Hash.new(0)
  @parameter_types.map do |t|
    get_parameter_name(t.name, usage_by_type_name)
  end
end

#sourceObject



10
11
12
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/generated_expression.rb', line 10

def source
  sprintf(@expression_template, *@parameter_types.map(&:name))
end