Class: FormElement

Inherits:
MechanizeElement show all
Defined in:
lib/web_minion/bots/elements/form_element.rb

Instance Attribute Summary

Attributes inherited from MechanizeElement

#bot, #element, #target, #target_type, #value

Instance Method Summary collapse

Constructor Details

#initialize(bot, target, value = nil, element = nil) ⇒ FormElement

Returns a new instance of FormElement.



4
5
6
# File 'lib/web_minion/bots/elements/form_element.rb', line 4

def initialize(bot, target, value = nil, element = nil)
  super(bot, target, value, element)
end

Instance Method Details

#getObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/web_minion/bots/elements/form_element.rb', line 8

def get
  case @target_type
  when :index
    index_get
  when :string_path
    string_get
  when :first_last
    first_last_get
  else
    raise(InvalidTargetType, "#{@target_type} is not valid!")
  end
end