Module: SecurityGuard::Concerns::Initializable::ClassMethods

Defined in:
lib/security_guard/concerns/initializable.rb

Instance Method Summary collapse

Instance Method Details

#initializable(*attributes) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/security_guard/concerns/initializable.rb', line 15

def initializable(*attributes)
  attributes.each do |name|
    self.send :attr_accessor, name
  end

  unless self.method_defined?(:initialize)
    self.send :define_method, :initialize, lambda { |args|
      initializable_attrs args
    }
  end
end