Skip to content

Commit

Permalink
Fix RDoc for Element (#87)
Browse files Browse the repository at this point in the history
* Add missing plus for `Element#has_text?`.
* Remove unneeded hash and duplicated `the` for `Element#text`.
  • Loading branch information
aleksandrilyin authored Jun 6, 2022
1 parent d442ccf commit afafbac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rexml/element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ def previous_element
# :call-seq:
# has_text? -> true or false
#
# Returns +true if the element has one or more text noded,
# Returns +true+ if the element has one or more text noded,
# +false+ otherwise:
#
# d = REXML::Document.new '<a><b/>text<c/></a>'
Expand All @@ -1006,15 +1006,15 @@ def has_text?
# text(xpath = nil) -> text_string or nil
#
# Returns the text string from the first text node child
# in a specified element, if it exists, # +nil+ otherwise.
# in a specified element, if it exists, +nil+ otherwise.
#
# With no argument, returns the text from the first text node in +self+:
#
# d = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# d.root.text.class # => String
# d.root.text # => "some text "
#
# With argument +xpath+, returns text from the the first text node
# With argument +xpath+, returns text from the first text node
# in the element that matches +xpath+:
#
# d.root.text(1) # => "this is bold!"
Expand Down

0 comments on commit afafbac

Please sign in to comment.