Class: Canvas::Models::BaseModel
- Inherits:
-
Object
- Object
- Canvas::Models::BaseModel
- Includes:
- ActiveModel::Serialization, ActiveModel::Validations
- Defined in:
- app/models/canvas/models/base_model.rb
Direct Known Subclasses
Account, Course, Enrollment, File, Folder, Group, GroupMembership, Section, Term, User, UserObserver, XList
Instance Method Summary collapse
- #==(other) ⇒ Object
- #after_initialize ⇒ Object
-
#initialize(attributes = {}) ⇒ BaseModel
constructor
A new instance of BaseModel.
Constructor Details
#initialize(attributes = {}) ⇒ BaseModel
Returns a new instance of BaseModel.
6 7 8 9 10 11 12 |
# File 'app/models/canvas/models/base_model.rb', line 6 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end after_initialize end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'app/models/canvas/models/base_model.rb', line 18 def ==(other) to_json == other.to_json end |
#after_initialize ⇒ Object
14 15 16 |
# File 'app/models/canvas/models/base_model.rb', line 14 def after_initialize # this method should be overwritten in subclass end |