Class: FillIN::Factory
- Inherits:
-
Object
- Object
- FillIN::Factory
- Defined in:
- lib/cucumber/pickles/steps/fill_in/factory.rb
Constant Summary collapse
- TAG =
/^(.+\S+)\s*\((.*)\)$/
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(label, value, within: nil) ⇒ Factory
constructor
A new instance of Factory.
Constructor Details
#initialize(label, value, within: nil) ⇒ Factory
Returns a new instance of Factory.
5 6 7 8 9 |
# File 'lib/cucumber/pickles/steps/fill_in/factory.rb', line 5 def initialize(label, value, within: nil) @label = label @value = value @within = within end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/cucumber/pickles/steps/fill_in/factory.rb', line 11 def call if in_quotes? remove_quotes! end if !@value.nil? && @value[':'] && !in_quotes? step = FillIN::ComplexInput elsif @label =~ TAG @label = $1 tag = $2 step = Pickles.config.step_by_tag(tag) || FillIN::Input else step = FillIN::Input end step.new(@label, @value, @within) end |