Class: Cucumber::CucumberExpressions::GeneratedExpression
- Inherits:
-
Object
- Object
- Cucumber::CucumberExpressions::GeneratedExpression
- Defined in:
- lib/cucumber/cucumber_expressions/generated_expression.rb
Instance Attribute Summary collapse
-
#parameter_types ⇒ Object
readonly
Returns the value of attribute parameter_types.
Instance Method Summary collapse
-
#initialize(expression_template, parameters_types) ⇒ GeneratedExpression
constructor
A new instance of GeneratedExpression.
- #parameter_names ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(expression_template, parameters_types) ⇒ GeneratedExpression
Returns a new instance of GeneratedExpression.
8 9 10 |
# File 'lib/cucumber/cucumber_expressions/generated_expression.rb', line 8 def initialize(expression_template, parameters_types) @expression_template, @parameter_types = expression_template, parameters_types end |
Instance Attribute Details
#parameter_types ⇒ Object (readonly)
Returns the value of attribute parameter_types.
6 7 8 |
# File 'lib/cucumber/cucumber_expressions/generated_expression.rb', line 6 def parameter_types @parameter_types end |
Instance Method Details
#parameter_names ⇒ Object
16 17 18 19 20 21 |
# File 'lib/cucumber/cucumber_expressions/generated_expression.rb', line 16 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 |
#source ⇒ Object
12 13 14 |
# File 'lib/cucumber/cucumber_expressions/generated_expression.rb', line 12 def source sprintf(@expression_template, *@parameter_types.map(&:name)) end |