Module TagModule
In: lib/rubyful_soup.rb

Methods

[]   []=   append   attrs   children   delete   each   find   find_all   find_all_text   find_text   has_key?   inspect   length   method_missing   new   prettify   recursive_children   render_contents   self_closing?   size   to_s   to_str  

Included Modules

Enumerable PageElement

Attributes

attrs  [RW] 
contents  [RW] 
name  [RW] 
string  [RW] 

Public Class methods

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

Public Instance methods

Adds the given tag to the contents of this tag

Turn the list of attributes into a hash on demand, so we don‘t have to do it for every tag while parsing.

Iterates over the direct children of this Tag.

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.

soup.title_tag, or soup.title, is the same as soup.find(‘title’)

Renders this tag and its contents as a pretty-printed string.

Renders the contents of this tag as a string.

size()

Alias for length

Renders this tag and its contents as a string. NOTE: since REXML consumes whitespace, this method is not certain to reproduce the whitespace present in the original string.

[Validate]