Module: Trailblazer::Declarative::Schema

Defined in:
lib/trailblazer/declarative/schema.rb

Overview

Include this to maintain inheritable, nested schemas with ::defaults and ::feature the way we have it in Representable, Reform, and Disposable.

The schema with its defnitions will be kept in ::definitions.

Requirements to includer: ::default_nested_class, override building with ::nested_builder.

Defined Under Namespace

Modules: DSL, State

Class Method Summary collapse

Class Method Details

.extended(extender) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/trailblazer/declarative/schema.rb', line 16

def self.extended(extender)
  extender.extend DSL                 # ::property
  # extender.extend Feature             # ::feature
  # extender.extend Heritage::DSL       # ::heritage
  # extender.extend Heritage::Inherited # ::included

  extender.initialize_state!() # replaces {@definitions ||= Definitions.new(definition_class)}
end