instance method itself

Ruby on Rails 4.2.9

Since v4.2.9 Last seen in v4.2.9

Signature

itself()

Returns the object itself.

Useful for chaining methods, such as Active Record scopes:

Event.public_send(state.presence_in([ :trashed, :drafted ]) || :itself).order(:created_at)

@return Object

Source
# File activesupport/lib/active_support/core_ext/object/itself.rb, line 11
    def itself
      self
    end

Defined in activesupport/lib/active_support/core_ext/object/itself.rb line 11 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Object

Type at least 2 characters to search.

↑↓ navigate · open · esc close