controller_class

controller_class() Instance Public methods

use_zone

use_zone(time_zone) Class Public methods Allows override of Time.zone locally inside supplied block; resets Time.zone to existing value when done.

server_software

server_software() Instance Public methods Returns the lowercase name of the HTTP server software.

day

day() Instance Public methods Alias for: days

bytes

bytes() Instance Public methods Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes byte

push

push(path) Instance Public methods Alias for: <<

qualified_const_defined?

qualified_const_defined?(path, search_parents=true) Instance Public methods

toggle

toggle(attribute) Instance Public methods Assigns to attribute the boolean opposite of attribute?. So if the predicate returns true the attribute will become false. This method toggles directly the underlying value without calling any setter. Returns self.

validate

validate(*args, &block) Instance Public methods Adds a validation method or block to the class. This is useful when overriding the validate instance method becomes too unwieldy and you're looking for more descriptive declaration of your validations. This can be done with a symbol pointing to a method: class Comment include ActiveModel::Validations validate :must_be_friends def must_be_friends errors.add(:base, 'Must be friends to leave a comment') unless commenter.f

mattr_reader

mattr_reader(*syms) Instance Public methods Defines a class attribute and creates a class and instance reader methods. The underlying the class variable is set to nil, if it is not previously defined. module HairColors mattr_reader :hair_colors end HairColors.hair_colors # => nil HairColors.class_variable_set("@@hair_colors", [:brown, :black]) HairColors.hair_colors # => [:brown, :black] The attribute name must be a valid method name in Ruby. module Foo mattr_reader :"1