persist

persist() Instance Public methods

condition_is_true

condition_is_true() Instance Public methods

new

new(attributes = {}) Class Public methods

with_timezone_config

with_timezone_config(cfg) Instance Public methods

with_options

with_options(options) Instance Public methods An elegant way to factor duplication out of options passed to a series of method calls. Each method called in the block, with the block variable as the receiver, will have its options merged with the default options hash provided. Each method called on the block variable must take an options hash as its final argument. Without with_options>, this code contains duplication: class Account < ActiveRecord::Base has_many :customers,

with_env_tz

with_env_tz(new_tz = 'US/Eastern') Instance Public methods

verify_default_timezone_config

verify_default_timezone_config() Instance Public methods

unescape

unescape(str, escaped = /%[a-fA-F\d]{2}/) Instance Public methods

try!

try!(*a, &b) Instance Public methods Same as try, but will raise a NoMethodError exception if the receiving is not nil and does not implement the tried method.

try

try(*a, &b) Instance Public methods Invokes the public method whose name goes as first argument just like public_send does, except that if the receiver does not respond to it the call returns nil rather than raising an exception. This method is defined to be able to write @person.try(:name) instead of @person ? @person.name : nil try returns nil when called on nil regardless of whether it responds to the method: nil.try(:to_i) # => nil, rather than 0 Arguments and blocks