Class: WebMinion::Bot

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

Direct Known Subclasses

CapybaraBot, MechanizeBot

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Bot

Returns a new instance of Bot.



6
7
8
# File 'lib/web_minion/bots/bot.rb', line 6

def initialize(config = {})
  @config = config
end

Instance Attribute Details

#botObject

Returns the value of attribute bot.



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

def bot
  @bot
end

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/web_minion/bots/bot.rb', line 3

def config
  @config
end

Instance Method Details

#execute_step(method, target, value = nil, element = nil, values_hash = {}) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/web_minion/bots/bot.rb', line 10

def execute_step(method, target, value = nil, element = nil, values_hash = {})
  if method == :save_value
    method(method).call(target, value, element, values_hash)
  else
    method(method).call(target, value, element)
  end
end