Class: TracksAttributes::Base
- Inherits:
-
Object
- Object
- TracksAttributes::Base
- Extended by:
- ClassMethods
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/tracks_attributes/base.rb
Overview
TracksAttributes::Base is a convienience class that offers the basic services available through the TracksAttribute module for plain old ruby objects.
-
it tracks attributes
-
it provides
Base::create
to enable re-hydration within the scope of a containing class that is being built from JSON or XML -
it includes
ActiveModel::Validations
Class Method Summary collapse
-
.create(attributes = {}, options = {}) ⇒ Object
The standard create class method needed by a class that implements TracksAttributes during re-hydration.
Instance Method Summary collapse
-
#initialize(attributes = {}, options = {}) ⇒ Base
constructor
The default :initialize method needed by a class that implements TracksAttributes during re-hydration.
Methods included from ClassMethods
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ Base
The default :initialize method needed by a class that implements TracksAttributes during re-hydration.
as instance variables.
37 38 39 |
# File 'lib/tracks_attributes/base.rb', line 37 def initialize(attributes = {}, = {}) self.all_attributes = attributes end |
Class Method Details
.create(attributes = {}, options = {}) ⇒ Object
The standard create class method needed by a class that implements TracksAttributes during re-hydration.
as instance variables.
25 26 27 |
# File 'lib/tracks_attributes/base.rb', line 25 def self.create(attributes = {}, = {}) self.new attributes, end |