try

try(*args) Instance Public methods Calling try on nil always returns nil. It becomes specially helpful when navigating through associations that may return nil. nil.try(:name) # => nil Without try @person && !@person.children.blank? && @person.children.first.name With try @person.try(:children).try(:first).try(:name)

new_menuspec

new_menuspec(menu_spec, parent = nil, tearoff = false, keys = nil) Class Public methods

owned?

File.owned?(file_name) â true or false Instance Public methods Returns true if the named file exists and the effective used id of the calling process is the owner of the file. file_name can be an IO object.

add_tag

add_tag(name, start, stop) Instance Public methods Add a new set of tags for an attribute. We allow separate start and end tags for flexibility

xml

xml() Instance Public methods BSTR xml return the XML source for the node and each of its descendants

url_for

url_for(options = nil) Instance Public methods Generate a url based on the options provided, default_url_options and the routes defined in routes.rb. The following options are supported: :only_path - If true, the relative url is returned. Defaults to false. :protocol - The protocol to connect to. Defaults to 'http'. :host - Specifies the host the link should be targeted at. If :only_path is false, this option must be provided either explicitly, or via default_url_options. :s

set_eoutvar

set_eoutvar(compiler, io_variable) Instance Public methods Instructs compiler how to write to io_variable

collect

enum.collect { |obj| block } â arrayenum.collect â an_enumerator Instance Public methods Returns a new array with the results of running block once for every element in enum. If no block is given, an enumerator is returned instead. (1..4).collect { |i| i*i } #=> [1, 4, 9, 16] (1..4).collect { "cat" } #=> ["cat", "cat", "cat", "cat"]

metrics_displayof 2

metrics_displayof(win, option=nil) Instance Public methods

exist?

exist?(name, options = nil) Instance Public methods Returns true if the cache contains an entry for the given key. Options are passed to the underlying cache implementation.