Used to construct C classes (CUnion
, CStruct
, etc)
Fiddle::Importer#struct
and Fiddle::Importer#union
wrap this functionality in an easy-to-use manner.
OpenSSL
IO
buffering mix-in module.
This module allows an OpenSSL::SSL::SSLSocket
to behave like an IO
.
You typically won’t use this module directly, you can see it implemented in OpenSSL::SSL::SSLSocket
.
This module contains configuration information about the SSL
extension, for example if socket support is enabled, or the host name TLS extension is enabled. Constants in this module will always be defined, but contain ‘true` or `false` values depending on the configuration of your OpenSSL
installation.
Socket::Constants
provides socket-related constants. All possible socket constants are listed in the documentation but they may not all be present on your platform.
If the underlying platform doesn’t define a constant the corresponding Ruby constant is not defined.
The WIN32OLE::VARIANT
module includes constants of VARIANT
type constants. The constants is used when creating WIN32OLE_VARIANT
object.
obj = WIN32OLE_VARIANT.new("2e3", WIN32OLE::VARIANT::VT_R4) obj.value # => 2000.0
The GC
profiler provides access to information on GC
runs including time, length and object space size.
Example:
GC::Profiler.enable require 'rdoc/rdoc' GC::Profiler.report GC::Profiler.disable
See also GC.count
, GC.malloc_allocated_size
and GC.malloc_allocations
A utility module for conversion routines, often handy in HTML generation.
The HTTPHeader
module defines methods for reading and writing HTTP
headers.
It is used as a mixin by other classes, to provide hash-like access to HTTP
header values. Unlike raw hash access, HTTPHeader
provides access via case-insensitive keys. It also provides methods for accessing commonly-used HTTP
header values in more convenient formats.
Mixin for HTTP and FTP URIs.
Adds named attributes to an object.
A template for stream parser listeners. Note that the declarations (attlistdecl, elementdecl, etc) are trivially processed; REXML
doesn’t yet handle doctype entity declarations, so you have to parse them out yourself.
ignorable_whitespace
WARNING
These methods are certainly going to change, until DTDs are fully supported. Be aware of this.
start_document end_document doctype elementdecl attlistdecl entitydecl notationdecl cdata xmldecl comment
A template for stream parser listeners. Note that the declarations (attlistdecl, elementdecl, etc) are trivially processed; REXML
doesn’t yet handle doctype entity declarations, so you have to parse them out yourself.
RSS
0.9 support RSS
has three different versions. This module contains support for version 0.9.1.
RSS
0.9 Producing our own RSS
feeds is easy as well. Let’s make a very basic feed:
require "rss" rss = RSS::Maker.make("0.91") do |maker| maker.channel.language = "en" maker.channel.author = "matz" maker.channel.updated = Time.now.to_s maker.channel.link = "http://www.ruby-lang.org/en/feeds/news.rss" maker.channel.title = "Example Feed" maker.channel.description = "A longer description of my feed." maker.image.url = "http://www.ruby-lang.org/images/logo.gif" maker.image.title = "An image" maker.items.new_item do |item| item.link = "http://www.ruby-lang.org/en/news/2010/12/25/ruby-1-9-2-p136-is-released/" item.title = "Ruby 1.9.2-p136 is released" item.updated = Time.now.to_s end end puts rss
As you can see, this is a very Builder-like DSL. This code will spit out an RSS
0.9 feed with one item. If we needed a second item, we’d make another block with maker.items.new_item and build a second one.
RSS
1.0 support RSS
has three different versions. This module contains support for version 1.0
RSS
1.0 Producing our own RSS
feeds is easy as well. Let’s make a very basic feed:
require "rss" rss = RSS::Maker.make("1.0") do |maker| maker.channel.language = "en" maker.channel.author = "matz" maker.channel.about = "About my feed." maker.channel.updated = Time.now.to_s maker.channel.link = "http://www.ruby-lang.org/en/feeds/news.rss" maker.channel.title = "Example Feed" maker.channel.description = "A longer description of my feed." maker.items.new_item do |item| item.link = "http://www.ruby-lang.org/en/news/2010/12/25/ruby-1-9-2-p136-is-released/" item.title = "Ruby 1.9.2-p136 is released" item.updated = Time.now.to_s end end puts rss
As you can see, this is a very Builder-like DSL. This code will spit out an RSS
1.0 feed with one item. If we needed a second item, we’d make another block with maker.items.new_item and build a second one.