lib/gogo_driver.rb in gogo_driver-0.0.2 vs lib/gogo_driver.rb in gogo_driver-0.0.3
- old
+ new
@@ -1,14 +1,18 @@
require "gogo_driver/version"
require "gogo_driver/entity"
module GogoDriver
- def init
- @entity = Entity.new
+ def go(url='https://www.google.com')
+ @entity = Entity.new unless @entity
+ @entity.go(url)
+ @last_url = url
end
+ module_function :go
def method_missing(method, *args, &block)
@entity.respond_to?(method) ? @entity.send(method, *args, &block) : super
rescue Errno::ECONNREFUSED
- @entity = Entity.new
+ go(@last_url)
+ @entity.send(method, *args, &block)
end
end