Class: CheckIn::ComplexInput

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/pickles/steps/check_in/complex_input.rb

Instance Method Summary collapse

Constructor Details

#initialize(label, value, within) ⇒ ComplexInput

Returns a new instance of ComplexInput.



3
4
5
6
7
# File 'lib/cucumber/pickles/steps/check_in/complex_input.rb', line 3

def initialize(label, value, within)
  @label = label
  @value = value
  @within = within || Capybara.current_session
end

Instance Method Details

#callObject



9
10
11
12
13
14
15
# File 'lib/cucumber/pickles/steps/check_in/complex_input.rb', line 9

def call
  @value.split(/\s*:\s*/).each.with_index do |value, index|
    input_locator = "#{label}[#{index}]"

    CheckIn::Input.new(input_locator, value, @within)
  end
end