Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Serialization is a module to include in your models when you want to represent your model as a serializable hash. You only need to define an attributes method and the rest is handled for you.
class User
include ActiveModel::Serialization
attr_accessor :first_name, :last_name
def attributes
{ 'first_name' => @first_name, 'last_name' => @last_name }
end
end