diff options
Diffstat (limited to 'actionpack/lib/action_controller/vendor/html-scanner/html')
-rw-r--r-- | actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb index fbf7ffc595..0fe2e6d1a6 100644 --- a/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb +++ b/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb @@ -207,12 +207,18 @@ module HTML class << self + # :call-seq: + # Selector.for_class(cls) => selector + # # Creates a new selector for the given class name. def for_class(cls) self.new([".?", cls]) end + # :call-seq: + # Selector.for_id(id) => selector + # # Creates a new selector for the given id. def for_id(id) self.new(["#?", id]) @@ -221,6 +227,9 @@ module HTML end + # :call-seq: + # Selector.new(string, [values ...]) => selector + # # Creates a new selector from a CSS 2 selector expression. # # The first argument is the selector expression. All other arguments @@ -333,6 +342,9 @@ module HTML end + # :call-seq: + # match(element, first?) => array or nil + # # Matches an element against the selector. # # For a simple selector this method returns an array with the @@ -422,6 +434,9 @@ module HTML end + # :call-seq: + # select(root) => array + # # Selects and returns an array with all matching elements, beginning # with one node and traversing through all children depth-first. # Returns an empty array if no match is found. |