label

label(object_name, method, content_or_options = nil, options = nil, &block) Instance Public methods Returns a label tag tailored for labelling an input field for a specified attribute (identified by method) on an object assigned to the template (identified by object). The text of label will default to the attribute name unless a translation is found in the current I18n locale (through helpers.label.<modelname>.<attribute>) or you specify it explicitly. Additional op

children

children(with_directory=true) Instance Public methods Returns the children of the directory (files and subdirectories, not recursive) as an array of Pathname objects. By default, the returned pathnames will have enough information to access the files. If you set with_directory to false, then the returned pathnames will contain the filename only. For example: pn = Pathname("/usr/lib/ruby/1.8") pn.children # -> [ Pathname:/usr/lib/ruby/1.8/English.rb, Pathname:/usr/

lineno

ios.lineno â integer Instance Public methods Returns the current line number in ios. The stream must be opened for reading. lineno counts the number of times gets is called rather than the number of newlines encountered. The two values will differ if gets is called with a separator other than newline. Methods that use $/ like each, lines and readline will also increment lineno. See also the $. variable. f = File.new("testfile") f.lineno #=> 0 f.gets #=> "This is l

casecmp

str.casecmp(other_str) â -1, 0, +1 or nil Instance Public methods Case-insensitive version of String#<=>. "abcdef".casecmp("abcde") #=> 1 "aBcDeF".casecmp("abcdef") #=> 0 "abcdef".casecmp("abcdefg") #=> -1 "abcdef".casecmp("ABCDEF") #=> 0

bbox

bbox(index) Instance Public methods

bm

bm(label_width = 0, *labels) Class Public methods A simple interface to the benchmark method, bm is generates sequential reports with labels. The parameters have the same meaning as for benchmark. require 'benchmark' n = 50000 Benchmark.bm(7) do |x| x.report("for:") { for i in 1..n; a = "1"; end } x.report("times:") { n.times do ; a = "1"; end } x.report("upto:") { 1.upto(n) do ; a = "1"; end } end Generates: user system total real for:

label

label(method, text = nil, options = {}, &block) Instance Public methods Returns a label tag tailored for labelling an input field for a specified attribute (identified by method) on an object assigned to the template (identified by object). The text of label will default to the attribute name unless a translation is found in the current I18n locale (through helpers.label.<modelname>.<attribute>) or you specify it explicitly. Additional options on the label tag can b

polar

Complex.polar(abs[, arg]) â complex Class Public methods Returns a complex object which denotes the given polar form. Complex.polar(3, 0) #=> (3.0+0.0i) Complex.polar(3, Math::PI/2) #=> (1.836909530733566e-16+3.0i) Complex.polar(3, Math::PI) #=> (-3.0+3.673819061467132e-16i) Complex.polar(3, -Math::PI/2) #=> (1.836909530733566e-16-3.0i)

call

call(env) Instance Public methods Define the Rack API for this engine.

abort

abort() Instance Public methods Ends the current #transaction, discarding any changes to the data store. Example: require "pstore" store = PStore.new("data_file.pstore") store.transaction do # begin transaction store[:one] = 1 # this change is not applied, see below... store[:two] = 2 # this change is not applied, see below... store.abort # end transaction here, discard all changes store[:three] = 3 # this change is never reached end WARNING: This me