lib/webdrone/text.rb in webdrone-1.7.8 vs lib/webdrone/text.rb in webdrone-1.8.0
- old
+ new
@@ -1,14 +1,16 @@
+# frozen_string_literal: true
+
module Webdrone
class Browser
def text
@text ||= Text.new self
end
end
class Text
- attr_accessor :a0
+ attr_reader :a0
def initialize(a0)
@a0 = a0
end
@@ -17,12 +19,12 @@
if item.is_a? Array
item.collect(&:text)
else
item.text
end
- rescue => exception
- Webdrone.report_error(@a0, exception)
+ rescue StandardError => error
+ Webdrone.report_error(@a0, error)
end
alias_method :id, :text
alias_method :css, :text
alias_method :link, :text
@@ -31,11 +33,11 @@
alias_method :option, :text
alias_method :xpath, :text
def page_title
@a0.driver.title
- rescue => exception
- Webdrone.report_error(@a0, exception)
+ rescue StandardError => error
+ Webdrone.report_error(@a0, error)
end
protected :text
end
end