Class: RSS::XMLScanListener
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
BaseListener ,
Utils
|
|
Instance Chain:
self,
ListenerMixin ,
XMLScan::Visitor,
BaseListener
|
|
Inherits: |
RSS::BaseListener
|
Defined in: | lib/rss/xmlscanner.rb |
Constant Summary
-
ENTITIES =
# File 'lib/rss/xmlscanner.rb', line 38{ 'lt' => '<', 'gt' => '>', 'amp' => '&', 'quot' => '"', 'apos' => '\'' }
ListenerMixin
- Included
Class Attribute Summary
BaseListener
- Inherited
Class Method Summary
BaseListener
- Inherited
.available_tags | return the tag_names for setters associated with uri. |
.class_name | retrieve class_name for the supplied uri and tag_name If it doesn’t exist, capitalize the tag_name. |
.getter, | |
.install_class_name | record class_name for the supplied uri and tag_name. |
.install_get_text_element, | |
.register_uri | register uri against this name. |
.setter | return the setter for the uri, tag_name pair, or nil. |
.uri_registered? | test if this uri is registered against this name. |
.def_get_text_element, | |
.install_accessor_base | set the accessor for the uri, tag_name pair. |
Utils
- Extended
element_initialize_arguments? | This method is used inside of several different objects to determine if special behavior is needed in the constructor. |
get_file_and_line_from_caller | Returns an array of two elements: the filename where the calling method is located, and the line number where it is defined. |
h, | |
html_escape | Takes a string |
new_with_value_if_need | If |
to_class_name | Given a |
Instance Attribute Summary
ListenerMixin
- Included
Instance Method Summary
- #on_attr_charref(code) (also: #on_attr_charref_hex)
-
#on_attr_charref_hex(code)
Alias for #on_attr_charref.
- #on_attr_entityref(ref)
- #on_attr_value(str)
- #on_attribute(name)
-
#on_cdata(data)
Alias for ListenerMixin#text.
-
#on_chardata(data)
Alias for ListenerMixin#text.
- #on_charref(code) (also: #on_charref_hex)
-
#on_charref_hex(code)
Alias for #on_charref.
- #on_entityref(ref)
- #on_etag(name)
-
#on_pi(name, content)
Alias for ListenerMixin#instruction.
- #on_stag(name)
- #on_stag_end(name)
- #on_stag_end_empty(name)
- #on_xmldecl_encoding(str)
- #on_xmldecl_end
- #on_xmldecl_standalone(str)
- #on_xmldecl_version(str)
- #entity(ref) private
ListenerMixin
- Included
#initialize, #instruction, #tag_end, #tag_start, #text, | |
#xmldecl | set instance vars for version, encoding, standalone. |
#_ns, #check_ns, #collect_attributes, #initial_start_entry, #initial_start_feed, #initial_start_RDF, #initial_start_rss, | |
#known_class? | See additional method definition at line 426. |
#parse_pi_content | Extract the first name=“value” pair from content. |
#setup_next_element, #setup_next_element_in_unknown_element, #split_name, #start_else_element, #start_get_text_element, #start_have_something_element |
Instance Method Details
#entity(ref) (private)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 112
def entity(ref) ent = ENTITIES[ref] if ent ent else wellformed_error("undefined entity: #{ref}") end end
#on_attr_charref(code) Also known as: #on_attr_charref_hex
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 96
def on_attr_charref(code) @current_attr << [code].pack('U') end
#on_attr_charref_hex(code)
Alias for #on_attr_charref.
# File 'lib/rss/xmlscanner.rb', line 100
alias_method(:on_attr_charref_hex, :on_attr_charref)
#on_attr_entityref(ref)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 92
def on_attr_entityref(ref) @current_attr << entity(ref) end
#on_attr_value(str)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 88
def on_attr_value(str) @current_attr << str end
#on_attribute(name)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 84
def on_attribute(name) @attrs[name] = @current_attr = '' end
#on_cdata(data)
Alias for ListenerMixin#text.
# File 'lib/rss/xmlscanner.rb', line 64
alias_method(:on_cdata, :text)
#on_chardata(data)
Alias for ListenerMixin#text.
# File 'lib/rss/xmlscanner.rb', line 63
alias_method(:on_chardata, :text)
#on_charref(code) Also known as: #on_charref_hex
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 74
def on_charref(code) text([code].pack('U')) end
#on_charref_hex(code)
Alias for #on_charref.
# File 'lib/rss/xmlscanner.rb', line 78
alias_method(:on_charref_hex, :on_charref)
#on_entityref(ref)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 70
def on_entityref(ref) text(entity(ref)) end
#on_etag(name)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 66
def on_etag(name) tag_end(name) end
#on_pi(name, content)
Alias for ListenerMixin#instruction.
# File 'lib/rss/xmlscanner.rb', line 62
alias_method(:on_pi, :instruction)
#on_stag(name)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 80
def on_stag(name) @attrs = {} end
#on_stag_end(name)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 102
def on_stag_end(name) tag_start(name, @attrs) end
#on_stag_end_empty(name)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 106
def on_stag_end_empty(name) tag_start(name, @attrs) tag_end(name) end
#on_xmldecl_encoding(str)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 50
def on_xmldecl_encoding(str) @encoding = str end
#on_xmldecl_end
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 58
def on_xmldecl_end xmldecl(@version, @encoding, @standalone == "yes") end
#on_xmldecl_standalone(str)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 54
def on_xmldecl_standalone(str) @standalone = str end
#on_xmldecl_version(str)
[ GitHub ]# File 'lib/rss/xmlscanner.rb', line 46
def on_xmldecl_version(str) @version = str end