lib/webdrone/text.rb in webdrone-0.9.8 vs lib/webdrone/text.rb in webdrone-0.9.9
- old
+ new
@@ -10,33 +10,33 @@
def initialize(a0)
@a0 = a0
end
- def find_text(text, n: 1, all: false, visible: true)
+ def text(text, n: 1, all: false, visible: true)
item = @a0.find.send __callee__, text, n: n, all: all, visible: visible
if item.is_a? Array
item.collect(&:text)
else
item.text
end
rescue => exception
Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end
- alias_method :id, :find_text
- alias_method :css, :find_text
- alias_method :link, :find_text
- alias_method :button, :find_text
- alias_method :on, :find_text
- alias_method :option, :find_text
- alias_method :xpath, :find_text
+ alias_method :id, :text
+ alias_method :css, :text
+ alias_method :link, :text
+ alias_method :button, :text
+ alias_method :on, :text
+ alias_method :option, :text
+ alias_method :xpath, :text
def page_title
@a0.driver.title
rescue => exception
Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end
- protected :find_text
+ protected :text
end
end