| Module | RSS::Utils |
| In: |
rss/utils.rb
|
# File rss/utils.rb, line 33 def element_initialize_arguments?(args) [true, false].include?(args[0]) and args[1].is_a?(Hash) end
# File rss/utils.rb, line 12 def get_file_and_line_from_caller(i=0) file, line, = caller[i].split(':') [file, line.to_i] end
escape ’&’, ’"’, ’<’ and ’>’ for use in HTML.
# File rss/utils.rb, line 18 def html_escape(s) s.to_s.gsub(/&/, "&").gsub(/\"/, """).gsub(/>/, ">").gsub(/</, "<") end
If value is an instance of class klass, return it, else create a new instance of klass with value value.
# File rss/utils.rb, line 25 def new_with_value_if_need(klass, value) if value.is_a?(klass) value else klass.new(value) end end
ruby-doc.org is hosted and maintained by James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, Arizona. The site was created in 2002 as part of the Ruby Documentation Project to promote the Ruby language and to help other Ruby hackers.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.