Module: ActiveModel
Overview
:markup: rdoc
Class Method Summary
- .eager_load!
-
.gem_version
Returns the currently loaded version of Active Model as a
Gem::Version. -
.version
Returns the currently loaded version of Active Model as a
Gem::Version. - .deprecator Internal use only
::ActiveSupport::Autoload - Extended
Instance Method Summary
-
#slice(*methods)
Returns a hash of the given methods with their names as keys and returned values as values.
-
#values_at(*methods)
Returns an array of the values returned by the given methods.
Class Method Details
.deprecator
This method is for internal use only.
[ GitHub ]
# File 'activemodel/lib/active_model/deprecator.rb', line 5
def self.deprecator # :nodoc: @deprecator ||= ActiveSupport::Deprecation.new end
.eager_load!
[ GitHub ]# File 'activemodel/lib/active_model.rb', line 81
def self.eager_load! super ActiveModel::Serializers.eager_load! end
.gem_version
Returns the currently loaded version of Active Model as a Gem::Version.
.version
Returns the currently loaded version of Active Model as a Gem::Version.
# File 'activemodel/lib/active_model/version.rb', line 8
def self.version gem_version end
Instance Method Details
#slice(*methods)
Returns a hash of the given methods with their names as keys and returned values as values.
person = {Person.new}(id: 1, name: "bob")
person.slice(:id, :name)
#### => { "id" => 1, "name" => "bob" }
# File 'activemodel/lib/active_model/model.rb', line 54
rdoc_method :method: slice
#values_at(*methods)
Returns an array of the values returned by the given methods.
person = {Person.new}(id: 1, name: "bob")
person.values_at(:id, :name)
#### => [1, "bob"]
# File 'activemodel/lib/active_model/model.rb', line 71
rdoc_method :method: values_at