strptime

DateTime.strptime([string='-4712-01-01T00:00:00+00:00'[, format='%FT%T%z'[ ,start=ITALY]]]) â datetime Class Public methods Parses the given representation of date and time with the given template, and creates a date object. strptime does not support specification of flags and width unlike strftime. DateTime.strptime('2001-02-03T04:05:06+07:00', '%Y-%m-%dT%H:%M:%S%z') #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...> DateTime.strptime('03-02-2001

add_development_dependency

add_development_dependency(gem, *requirements) Instance Public methods Adds a development dependency named gem with requirements to this gem. Usage: spec.add_development_dependency 'example', '~> 1.1', '>= 1.1.4' Development dependencies aren't installed by default and aren't activated when a gem is required.

resolver

resolver(*uri_args) Instance Public methods

main

main() Instance Public methods

join

join(array) Class Public methods Alias for: shelljoin

link_to_unless_current

link_to_unless_current(name, options = {}, html_options = {}, &block) Instance Public methods Creates a link tag of the given name using a URL created by the set of options unless the current request URI is the same as the links, in which case only the name is returned (or the given block is yielded, if one exists). You can give link_to_unless_current a block which will specialize the default behavior (e.g., show a âStart Hereâ link rather than the link's text). Examples Let's

joins

joins(*args) Instance Public methods Performs a joins on args: User.joins(:posts) => SELECT "users".* FROM "users" INNER JOIN "posts" ON "posts"."user_id" = "users"."id" You can use strings in order to customize your joins: User.joins("LEFT JOIN bookmarks ON bookmarks.bookmarkable_type = 'Post' AND bookmarks.user_id = users.id") => SELECT "users".* FROM "users" LEFT JOIN bookmarks ON bookmarks.bookmarkable_type = 'Post' AND bookmarks.user_id = users.id

[]

[](name) Instance Public methods Fetches an attribute value. If you want to get the Attribute itself, use #get_attribute() name an XPath attribute name. Namespaces are relevant here. Returns the String value of the matching attribute, or nil if no matching attribute was found. This is the unnormalized value (with entities expanded). doc = Document.new "<a foo:att='1' bar:att='2' att='&lt;'/>" doc.root.attributes['att'] #-> '<' doc.root.attributes[

calculate_ip

calculate_ip() Instance Public methods Sort through the various IP address headers, looking for the IP most likely to be the address of the actual remote client making this request. REMOTE_ADDR will be correct if the request is made directly against the Ruby process, on e.g. Heroku. When the request is proxied by another server like HAProxy or Nginx, the IP address that made the original request will be put in an X-Forwarded-For header. If there are multiple proxies, that header ma

handle_class_module

handle_class_module(var_name, type, class_name, parent, in_module) Instance Public methods Creates a new RDoc::NormalClass or RDoc::NormalModule based on type named class_name in parent which was assigned to the C var_name.