Module: ActiveOopish::Inheritance::ClassMethods

Defined in:
lib/activeoopish/inheritance.rb

Instance Method Summary collapse

Instance Method Details

#instantiate_as(class_name, options = {}) ⇒ Object

Public:

class_name - A String represents the class which instantiates an instance. condition - A Hash.



17
18
19
20
# File 'lib/activeoopish/inheritance.rb', line 17

def instantiate_as(class_name, options = {})
  @instantiation_rules ||= []
  @instantiation_rules << { class_name: class_name, condition: options.stringify_keys }
end