Module: Materialist::Materializer

Defined in:
lib/materialist/materializer.rb,
lib/materialist/materializer/internals.rb,
lib/materialist/materializer/internals/dsl.rb,
lib/materialist/materializer/internals/resources.rb,
lib/materialist/materializer/internals/link_mapping.rb,
lib/materialist/materializer/internals/materializer.rb,
lib/materialist/materializer/internals/class_methods.rb,
lib/materialist/materializer/internals/field_mapping.rb,
lib/materialist/materializer/internals/link_href_mapping.rb

Defined Under Namespace

Modules: Internals

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/materialist/materializer.rb', line 6

def self.included(base)
  base.extend(Internals::ClassMethods)
  base.extend(Internals::DSL)

  root_mapping = []
  base.instance_variable_set(:@__materialist_options, {
    mapping: root_mapping,
    links_to_materialize: {}
  })
  base.instance_variable_set(:@__materialist_dsl_mapping_stack, [root_mapping])
end