select_year

select_year(date, options = {}, html_options = {}) Instance Public methods Returns a select tag with options for each of the five years on each side of the current, which is selected. The five year radius can be changed using the :start_year and :end_year keys in the options. Both ascending and descending year lists are supported by making :start_year less than or greater than :end_year. The date can also be substituted for a year given as a number. Override the field name using th

thread_variable_get

thr.thread_variable_get(key) â obj or nil Instance Public methods Returns the value of a thread local variable that has been set. Note that these are different than fiber local values. For fiber local values, please see #[] and #[]=. Thread local values are carried along with threads, and do not respect fibers. For example: Thread.new { Thread.current.thread_variable_set("foo", "bar") # set a thread local Thread.current["foo"] = "bar" # set a fiber local

expires_in

expires_in(seconds, options = {}) Instance Public methods Sets a HTTP 1.1 Cache-Control header. Defaults to issuing a private instruction, so that intermediate caches must not cache the response. expires_in 20.minutes expires_in 3.hours, public: true expires_in 3.hours, public: true, must_revalidate: true This method will overwrite an existing Cache-Control header. See www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. The method will also ensure a HTTP Date h

round

time.round([ndigits]) â new_time Instance Public methods Rounds sub seconds to a given precision in decimal digits (0 digits by default). It returns a new Time object. ndigits should be zero or positive integer. require 'time' t = Time.utc(2010,3,30, 5,43,"25.123456789".to_r) p t.iso8601(10) #=> "2010-03-30T05:43:25.1234567890Z" p t.round.iso8601(10) #=> "2010-03-30T05:43:25.0000000000Z" p t.round(0).iso8601(10) #=> "2010-03-30T05:43:25.0000000000Z" p t.

def_elements_class_accessor

def_elements_class_accessor(klass, name, full_name, klass_name, plural_name, recommended_attribute_name=nil) Instance Public methods

persisted?

persisted?() Instance Public methods

columnconfigure

columnconfigure(master, index, args) Class Public methods

block_scanf

block_scanf(fstr) Instance Public methods Scans the current string until the match is exhausted yielding each match as it is encountered in the string. A block is not necessary as the results will simply be aggregated into the final array. "123 456".block_scanf("%d") # => [123, 456] If a block is given, the value from that is returned from the yield is added to an output array. "123 456".block_scanf("%d) do |digit,| # the ',' unpacks the Array digit + 100 end # => [223, 55

flash

flash() Instance Public methods Access the contents of the flash. Use flash["notice"] to read a notice you put there or flash["notice"] = "hello" to put a new one.

new

new() Class Public methods