Class: RSS::BaseListener
Direct Known Subclasses
Constant Summary collapse
- @@setters =
{}
- @@registered_uris =
{}
- @@class_names =
{}
Class Method Summary collapse
-
.available_tags(uri) ⇒ Object
return the tag_names for setters associated with uri.
-
.class_name(uri, tag_name) ⇒ Object
retrieve class_name for the supplied uri and tag_name If it doesn’t exist, capitalize the tag_name.
-
.install_class_name(uri, tag_name, class_name) ⇒ Object
record class_name for the supplied uri and tag_name.
- .install_get_text_element(uri, name, setter) ⇒ Object
- .raise_for_undefined_entity? ⇒ Boolean
-
.register_uri(uri, name) ⇒ Object
register uri against this name.
-
.setter(uri, tag_name) ⇒ Object
return the setter for the uri, tag_name pair, or nil.
-
.uri_registered?(uri, name) ⇒ Boolean
test if this uri is registered against this name.
Methods included from Utils
element_initialize_arguments?, get_file_and_line_from_caller, html_escape, new_with_value_if_need, to_class_name
Class Method Details
.available_tags(uri) ⇒ Object
return the tag_names for setters associated with uri
191 192 193 194 195 196 197 |
# File 'lib/rss/parser.rb', line 191 def (uri) begin @@setters[uri].keys rescue NameError [] end end |
.class_name(uri, tag_name) ⇒ Object
retrieve class_name for the supplied uri and tag_name If it doesn’t exist, capitalize the tag_name
218 219 220 221 222 223 224 |
# File 'lib/rss/parser.rb', line 218 def class_name(uri, tag_name) begin @@class_names[uri][tag_name] rescue NameError tag_name[0,1].upcase + tag_name[1..-1] end end |
.install_class_name(uri, tag_name, class_name) ⇒ Object
record class_name for the supplied uri and tag_name
211 212 213 214 |
# File 'lib/rss/parser.rb', line 211 def install_class_name(uri, tag_name, class_name) @@class_names[uri] ||= {} @@class_names[uri][tag_name] = class_name end |
.install_get_text_element(uri, name, setter) ⇒ Object
226 227 228 229 |
# File 'lib/rss/parser.rb', line 226 def install_get_text_element(uri, name, setter) install_setter(uri, name, setter) def_get_text_element(uri, name, *get_file_and_line_from_caller(1)) end |
.raise_for_undefined_entity? ⇒ Boolean
231 232 233 |
# File 'lib/rss/parser.rb', line 231 def raise_for_undefined_entity? true end |
.register_uri(uri, name) ⇒ Object
register uri against this name.
200 201 202 203 |
# File 'lib/rss/parser.rb', line 200 def register_uri(uri, name) @@registered_uris[name] ||= {} @@registered_uris[name][uri] = nil end |
.setter(uri, tag_name) ⇒ Object
return the setter for the uri, tag_name pair, or nil.
181 182 183 184 185 186 187 |
# File 'lib/rss/parser.rb', line 181 def setter(uri, tag_name) begin @@setters[uri][tag_name] rescue NameError nil end end |
.uri_registered?(uri, name) ⇒ Boolean
test if this uri is registered against this name
206 207 208 |
# File 'lib/rss/parser.rb', line 206 def uri_registered?(uri, name) @@registered_uris[name].has_key?(uri) end |