Skip to content

Commit

Permalink
Merge pull request #947 from mdgreenfield/Node#all-documentation-updates
Browse files Browse the repository at this point in the history
Adding documentation for Capybara::Result to be more explicit about what
  • Loading branch information
jnicklas committed Feb 15, 2013
2 parents cdda35b + 68fd350 commit 8438329
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capybara/node/finders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def find_by_id(id)
# @option options [Boolean] visible Only find elements that are visible on the page. Setting this to false
# (the default, unless Capybara.ignore_hidden_elements = true), finds
# invisible _and_ visible elements.
# @return [Array[Capybara::Element]] The found elements
# @return [Capybara::Result] A collection of found elements
#
def all(*args)
query = Capybara::Query.new(*args)
Expand Down
17 changes: 17 additions & 0 deletions lib/capybara/result.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
require 'forwardable'

module Capybara

##
# A {Capybara::Result} represents a collection of {Capybara::Element} on the page. It is possible to interact with this
# collection similar to an Array because it implements Enumerable and offers the following Array methods through delegation:
#
# * []
# * each()
# * at()
# * size()
# * count()
# * length()
# * first()
# * last()
# * empty?()
#
# @see Capybara::Element
#
class Result
include Enumerable
extend Forwardable
Expand Down

0 comments on commit 8438329

Please sign in to comment.