Module: ActiveModel::Attributes

Extended by:
ActiveSupport::Concern
Includes:
AttributeMethods
Defined in:
lib/active_model/attributes.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ClassMethods

Constant Summary

Constants included from AttributeMethods

ActiveModel::AttributeMethods::AttrNames, ActiveModel::AttributeMethods::CALL_COMPILABLE_REGEXP, ActiveModel::AttributeMethods::NAME_COMPILABLE_REGEXP

Instance Method Summary collapse

Methods included from AttributeMethods

#attribute_missing, #method_missing, #respond_to?, #respond_to_without_attributes?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveModel::AttributeMethods

Instance Method Details

#attributesObject



69
70
71
# File 'lib/active_model/attributes.rb', line 69

def attributes
  @attributes.to_hash
end

#initializeObject



64
65
66
67
# File 'lib/active_model/attributes.rb', line 64

def initialize(*)
  @attributes = self.class._default_attributes.deep_dup
  super
end