Class: OptionLab::Models::BaseModel

Inherits:
Object
  • Object
show all
Defined in:
lib/option_lab/models.rb

Overview

Base class for all model classes

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BaseModel

Returns a new instance of BaseModel.



22
23
24
25
26
27
28
# File 'lib/option_lab/models.rb', line 22

def initialize(attributes = {})
  attributes.each do |key, value|
    send("#{key}=", value) if respond_to?("#{key}=")
  end

  validate! if respond_to?(:validate!)
end