module CucumberSteps::Browser::ScopeHandler

Public Instance Methods

add_locating_scope(locating_scope_name, &block) click to toggle source
# File lib/cucumber_steps/browser/scope_handler.rb, line 13
def add_locating_scope(locating_scope_name, &block)
  locating_scopes.push([locating_scope_name.to_s.to_sym, block])
  nil
end
clear_locating_scopes!() click to toggle source
# File lib/cucumber_steps/browser/scope_handler.rb, line 24
def clear_locating_scopes!
  locating_scopes.clear
  nil
end
current_scope() click to toggle source
# File lib/cucumber_steps/browser/scope_handler.rb, line 3
def current_scope
  target_scope = self

  locating_scopes.each do |location_def|
    target_scope = location_def[1].call(target_scope)
  end

  target_scope
end
pop_locating_scope(locating_scope_name) click to toggle source
# File lib/cucumber_steps/browser/scope_handler.rb, line 18
def pop_locating_scope(locating_scope_name)
  locating_scope_name = locating_scope_name.to_s.to_sym
  locating_scopes.delete_if { |name, block| name == locating_scope_name }
  nil
end

Protected Instance Methods

locating_scopes() click to toggle source
# File lib/cucumber_steps/browser/scope_handler.rb, line 31
def locating_scopes
  @locating_scopes ||= []
end