Class: MechanizeElement

Inherits:
Object
  • Object
show all
Defined in:
lib/web_minion/bots/elements/mechanize_element.rb

Direct Known Subclasses

FileUploadElement, FormElement

Defined Under Namespace

Classes: InvalidTargetType

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MechanizeElement.



6
7
8
9
10
11
12
# 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

Instance Attribute Details

#botObject (readonly)

Returns the value of attribute bot.



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

def bot
  @bot
end

#elementObject (readonly)

Returns the value of attribute element.



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

def element
  @element
end

#targetObject (readonly)

Returns the value of attribute target.



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

def target
  @target
end

#target_typeObject (readonly)

Returns the value of attribute target_type.



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

def target_type
  @target_type
end

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end