package_version 2

package_version() Class Public methods

attribute_names

attribute_names() Instance Public methods Returns an array of names for the attributes available on this object. class Person < ActiveRecord::Base end person = Person.new person.attribute_names # => ["id", "created_at", "updated_at", "name", "age"]

new

TracePoint.new(*events) { |obj| block } â obj Class Public methods Returns a new TracePoint object, not enabled by default. Next, in order to activate the trace, you must use #enable trace = TracePoint.new(:call) do |tp| p [tp.lineno, tp.defined_class, tp.method_id, tp.event] end #=> #<TracePoint:0x007f17372cdb20> trace.enable #=> #<TracePoint:0x007f17372cdb20> puts "Hello, TracePoint!" # ... # [48, IRB::Notifier::AbstractNotifier, :printf, :call]

each_pair

ENV.each_pair { |name, value| } â HashENV.each_pair â Enumerator Class Public methods Yields each environment variable name and value. If no block is given an Enumerator is returned.

third

third(*args) Instance Public methods Same as first except returns only the third record.

new

new() Class Public methods

controller

controller() Instance Public methods Gets a new instance of a controller object. This method assumes an ApplicationController exists, and it extends ActionController::Base

set_style_layout

set_style_layout(style, elem, slot, value=None) Instance Public methods

root

root(options = {}) Instance Public methods You can specify what Rails should route â/â to with the root method: root to: 'pages#main' For options, see match, as root uses it internally. You can also pass a string which will expand root 'pages#main' You should put the root route at the top of config/routes.rb, because this means it will be matched first. As this is the most popular route of most Rails applications, this is beneficial.

search

search(container, keys={}) Class Public methods