Class: Canvas::Models::BaseModel

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serialization, ActiveModel::Validations
Defined in:
app/models/canvas/models/base_model.rb

Instance Method Summary collapse

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_initializeObject



14
15
16
# File 'app/models/canvas/models/base_model.rb', line 14

def after_initialize
  # this method should be overwritten in subclass
end