Module | TagModule |
In: |
lib/rubyful_soup.rb
|
attrs | [RW] | |
contents | [RW] | |
name | [RW] | |
string | [RW] |
I tried to have Tag subclass Method, but it killed the whole thing. Maybe I should just leave well enough alone.
def arity
return methods('find_all').arity
end
def call(*args)
return find_all(*args)
end
def to_proc
return methods('find_all').to_proc
end
Turn the list of attributes into a hash on demand, so we don‘t have to do it for every tag while parsing.
Returns the first Tag or NavigableString object that matches the given criteria. Takes much the same arguments as fetch. args: :attrs :text :limit :recursive
Extracts a list of Tag objects that match the given criteria. You can specify the name of the Tag and any attributes you want the Tag to have.
The value of a key-value pair in the ‘attrs’ map can be a string, a list of strings, a regular expression object, or a Proc object that takes a string and returns whether or not the string matches for some custom definition of ‘matches’. The same is true of the tag name, except that a Proc object will be passed the Tag object instead of just a string. Args: :attrs :text :limit :recursive
Convenience method to retrieve all pieces of text matching the given criteria. ‘text’ can be a string, a regular expression object, a callable that takes a string and returns whether or not the string ‘matches’, etc. Args: :limit
Convenience method to retrieve the first piece of text matching the given criteria. ‘text’ can be a string, a regular expression object, a Proc that takes a string and returns whether or not the string ‘matches’, etc.