class MechanizeElement

Attributes

bot[R]
element[R]
target[R]
target_type[R]
value[R]

Public Class Methods

new(bot, target, value = nil, element = nil) click to toggle source
# File lib/web_minion/bots/elements/mechanize_element.rb, line 6
def initialize(bot, target, value = nil, element = nil)
  @bot = bot
  @target = target
  @target_type = determine_target_type(target)
  @value = value
  @element = element
end

Private Instance Methods

determine_target_type(target) click to toggle source
# File lib/web_minion/bots/elements/mechanize_element.rb, line 16
def determine_target_type(target)
  if target.is_a? Integer
    return :index
  else
    if %w(first last).include?(target)
      return :first_last
    end

    :string_path
  end
end