Module: Materializer::Base::ClassMethods

Defined in:
lib/materializer/base.rb

Instance Method Summary collapse

Instance Method Details

#add_materializer(options) ⇒ Object

Add a materializer profile.



32
33
34
35
36
# File 'lib/materializer/base.rb', line 32

def add_materializer(options) # :nodoc:
  materializers = self.send(:materializers)
  materializers << options
  self.send(:materializers=, materializers)
end

#materialize(options) ⇒ Object

Instruct the class, on save to materialize using a method into a particular attribute.



25
26
27
28
# File 'lib/materializer/base.rb', line 25

def materialize(options)
  self.send(:materializers=, []) if self.send(:materializers).nil?
  self.add_materializer(options)
end