Module: Dcmgr::Models::Account::SystemAccount

Defined in:
lib/dcmgr/models/account.rb

Class Method Summary collapse

Class Method Details

.define_account(class_name, &blk) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/dcmgr/models/account.rb', line 73

def self.(class_name, &blk)
  unless class_name.is_a?(Symbol) || class_name.is_a?(String)
    raise ArgumentError
  end

  c = Class.new(Account, &blk)
  self.const_set(class_name.to_sym, c)
  Account.sti_model_map[c.uuid] = c
  Account.sti_key_map[c.to_s] = c.uuid
  c
end