Class: Alchemrest::Data::Schema

Inherits:
Record
  • Object
show all
Defined in:
lib/alchemrest/data/schema.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary

Constants inherited from Record

Record::DEFAULTS

Instance Method Summary collapse

Methods inherited from Record

new

Instance Method Details

#included(host) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/alchemrest/data/schema.rb', line 6

def included(host)
  super

  host.extend(ClassMethods)

  host.const_set(
    :Collection,
    Class.new(host) do
      const_set :TRANSFORM, superclass::TRANSFORM.array

      def self.capture_configuration
        superclass.capture_configuration
      end
    end,
  )

  # Store the graph as a constant for easy access from other classes
  host.const_set(:GRAPH, extract_graph(host))
end