module Howitzer::Web::IframeDsl

This module combines iframe dsl methods

Private Instance Methods

convert_iframe_arguments(args, params) click to toggle source
# File lib/howitzer/web/iframe_dsl.rb, line 27
def convert_iframe_arguments(args, params)
  new_args = args.deep_dup
  hash = new_args.pop.transform_keys(&:to_sym).merge(params.transform_keys(&:to_sym)) if new_args.last.is_a?(Hash)
  new_args << hash if hash.present?
  new_args
end
iframe_element_selector(args, params) click to toggle source
# File lib/howitzer/web/iframe_dsl.rb, line 14
def iframe_element_selector(args, params)
  args = convert_iframe_arguments(args, params)
  case args[0]
  when String, Hash
    [:frame, *args]
  when Integer
    idx = args.shift
    ["iframe:nth-of-type(#{idx + 1})", *args]
  else
    args
  end
end