Module: Watchmaker::Integrations::ClassMethods

Defined in:
lib/watchmaker/integrations.rb

Instance Method Summary collapse

Instance Method Details

#from_factory(factory, method = :create) ⇒ Object

Construct from a factory.



11
12
13
# File 'lib/watchmaker/integrations.rb', line 11

def from_factory(factory, method = :create)
  Factory.send(method, factory.to_sym)
end

#from_watchmaker(watchmaker, method = :construct) ⇒ Object

Construct from another watchmaker.



17
18
19
# File 'lib/watchmaker/integrations.rb', line 17

def from_watchmaker(watchmaker, method = :construct)
  self.send(method, watchmaker.to_sym)
end